Personal wiki notebook (not under development)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

User_revision.py 1.0KB

123456789101112131415161718192021222324252627282930
  1. class User_revision( object ):
  2. """
  3. A revision timestamp along with information on the user that made that revision.
  4. """
  5. def __init__( self, revision, user_id = None, username = None ):
  6. """
  7. Create a User_revision with the given timestamp and user information.
  8. @type revision: datetime
  9. @param revision: revision timestamp
  10. @type user_id: unicode or NoneType
  11. @param user_id: id of user who made this revision (optional, defaults to None)
  12. @type username: username of user who made this revision (optional, defaults to None)
  13. @rtype: User_revision
  14. @return: newly constructed User_revision object
  15. """
  16. self.__revision = revision
  17. self.__user_id = user_id
  18. self.__username = username
  19. def to_dict( self ):
  20. return dict(
  21. revision = self.__revision,
  22. user_id = self.__user_id,
  23. username = self.__username,
  24. )
  25. revision = property( lambda self: self.__revision )
  26. user_id = property( lambda self: self.__user_id )
  27. username = property( lambda self: self.__username )