Archived
1
0
This repository has been archived on 2023-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
luminotes/model/User_revision.py
Dan Helfman 5520fe5892 * make a User_revision object containing a revision timestamp, user_id, username
* change controller.Notebooks.load_note_revisions() to select and return User_revision objects
 * change controller.Notebooks.save_note() to use User_revision objects for new_revision and previous_revision as well
 * update client to deal with new load_note_revisions() return values (make sure all uses of revisions_list are updated)
 * update client to deal with new new_revision/previous_revision
 * update changes pulldown to show username along with each timestamp
 * update model.Invite to load redeemed_username along with redeemed_user_id
 * display the redeemed username next to each email address in the "share this notebook" note
2008-01-04 04:45:43 +00:00

31 lines
1.0 KiB
Python

class User_revision( object ):
"""
A revision timestamp along with information on the user that made that revision.
"""
def __init__( self, revision, user_id = None, username = None ):
"""
Create a User_revision with the given timestamp and user information.
@type revision: datetime
@param revision: revision timestamp
@type user_id: unicode or NoneType
@param user_id: id of user who made this revision (optional, defaults to None)
@type username: username of user who made this revision (optional, defaults to None)
@rtype: User_revision
@return: newly constructed User_revision object
"""
self.__revision = revision
self.__user_id = user_id
self.__username = username
def to_dict( self ):
return dict(
revision = self.__revision,
user_id = self.__user_id,
username = self.__username,
)
revision = property( lambda self: self.__revision )
user_id = property( lambda self: self.__user_id )
username = property( lambda self: self.__username )