witten
/
luminotes
Archived
1
0
Fork 0

Changed things so the client is responsible for filtering out deleted notebooks from the display instead of the server.

This commit is contained in:
Dan Helfman 2007-11-17 04:55:53 +00:00
parent 8fe52cef50
commit 34f7d223d1
2 changed files with 4 additions and 9 deletions

View File

@ -129,7 +129,7 @@ class User( Persistent ):
def sql_load_by_email_address( email_address ): def sql_load_by_email_address( email_address ):
return "select * from luminotes_user_current where email_address = %s;" % quote( email_address ) return "select * from luminotes_user_current where email_address = %s;" % quote( email_address )
def sql_load_notebooks( self, parents_only = False, deleted = False ): def sql_load_notebooks( self, parents_only = False ):
""" """
Return a SQL string to load a list of the notebooks to which this user has access. Return a SQL string to load a list of the notebooks to which this user has access.
""" """
@ -138,15 +138,10 @@ class User( Persistent ):
else: else:
parents_only_clause = "" parents_only_clause = ""
if deleted:
deleted_clause = " and deleted = 't'"
else:
deleted_clause = " and deleted = 'f'"
return \ return \
"select notebook_current.*, user_notebook.read_write from user_notebook, notebook_current " + \ "select notebook_current.*, user_notebook.read_write from user_notebook, notebook_current " + \
"where user_id = %s%s%s and user_notebook.notebook_id = notebook_current.id order by revision;" % \ "where user_id = %s%s and user_notebook.notebook_id = notebook_current.id order by revision;" % \
( quote( self.object_id ), parents_only_clause, deleted_clause ) ( quote( self.object_id ), parents_only_clause )
def sql_save_notebook( self, notebook_id, read_write = True ): def sql_save_notebook( self, notebook_id, read_write = True ):
""" """

View File

@ -4,7 +4,7 @@ from Rounded_div import Rounded_div
class Link_area( Div ): class Link_area( Div ):
def __init__( self, notebooks, notebook, total_notes_count, parent_id, notebook_path, user ): def __init__( self, notebooks, notebook, total_notes_count, parent_id, notebook_path, user ):
linked_notebooks = [ nb for nb in notebooks if nb.read_write and nb.name not in ( u"trash" ) ] linked_notebooks = [ nb for nb in notebooks if nb.read_write and nb.name not in ( u"trash" ) and nb.deleted is False ]
Div.__init__( Div.__init__(
self, self,