app/soc/models/work.py
changeset 584 ba8a624506e5
parent 545 217921e76f50
child 621 21aea6e45a9d
equal deleted inserted replaced
583:12960609a69c 584:ba8a624506e5
    43 
    43 
    44   #: Required 1:1 relationship indicating the User who initially authored the
    44   #: Required 1:1 relationship indicating the User who initially authored the
    45   #: Work (this relationship is needed to keep track of lifetime document
    45   #: Work (this relationship is needed to keep track of lifetime document
    46   #: creation limits, used to prevent spamming, etc.).
    46   #: creation limits, used to prevent spamming, etc.).
    47   author = db.ReferenceProperty(reference_class=soc.models.user.User,
    47   author = db.ReferenceProperty(reference_class=soc.models.user.User,
    48                                  required=True, collection_name="documents",
    48                                  required=True, collection_name="created_documents",
    49                                  verbose_name=ugettext_lazy('Created by'))
    49                                  verbose_name=ugettext_lazy('Created by'))
    50 
    50 
    51   #: Required field indicating the "title" of the work, which may have
    51   #: Required field indicating the "title" of the work, which may have
    52   #: different uses depending on the specific type of the work. Works
    52   #: different uses depending on the specific type of the work. Works
    53   #: can be indexed, filtered, and sorted by 'title'.
    53   #: can be indexed, filtered, and sorted by 'title'.
    70   #: date when the work was created
    70   #: date when the work was created
    71   created = db.DateTimeProperty(auto_now_add=True)
    71   created = db.DateTimeProperty(auto_now_add=True)
    72   
    72   
    73   #: date when the work was last modified
    73   #: date when the work was last modified
    74   modified = db.DateTimeProperty(auto_now=True)
    74   modified = db.DateTimeProperty(auto_now=True)
       
    75   
       
    76   # indicating wich user last modified the work. Used in displaying Work
       
    77   modified_by = db.ReferenceProperty(reference_class=soc.models.user.User,
       
    78                                  required=True, collection_name="modified_documents",
       
    79                                  verbose_name=ugettext_lazy('Modified by'))
    75 
    80 
    76   # TODO: some sort of access control preferences are needed at this basic
    81   # TODO: some sort of access control preferences are needed at this basic
    77   #   level.  Works need to be restrict-able to:
    82   #   level.  Works need to be restrict-able to:
    78   #    * the authors only
    83   #    * the authors only
    79   #    * the administrators of the Groups that the authors are in
    84   #    * the administrators of the Groups that the authors are in