app/soc/models/work.py
changeset 621 21aea6e45a9d
parent 584 ba8a624506e5
child 970 8b5611d5b053
equal deleted inserted replaced
620:e74e0b74625f 621:21aea6e45a9d
    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="created_documents",
    48                                 required=True,
    49                                  verbose_name=ugettext_lazy('Created by'))
    49                                 collection_name="created_documents",
       
    50                                 verbose_name=ugettext_lazy('Created by'))
    50 
    51 
    51   #: Required field indicating the "title" of the work, which may have
    52   #: Required field indicating the "title" of the work, which may have
    52   #: different uses depending on the specific type of the work. Works
    53   #: different uses depending on the specific type of the work. Works
    53   #: can be indexed, filtered, and sorted by 'title'.
    54   #: can be indexed, filtered, and sorted by 'title'.
    54   title = db.StringProperty(required=True,
    55   title = db.StringProperty(required=True,
    73   #: date when the work was last modified
    74   #: date when the work was last modified
    74   modified = db.DateTimeProperty(auto_now=True)
    75   modified = db.DateTimeProperty(auto_now=True)
    75   
    76   
    76   # indicating wich user last modified the work. Used in displaying Work
    77   # indicating wich user last modified the work. Used in displaying Work
    77   modified_by = db.ReferenceProperty(reference_class=soc.models.user.User,
    78   modified_by = db.ReferenceProperty(reference_class=soc.models.user.User,
    78                                  required=True, collection_name="modified_documents",
    79                                      required=True,
    79                                  verbose_name=ugettext_lazy('Modified by'))
    80                                      collection_name="modified_documents",
       
    81                                      verbose_name=ugettext_lazy('Modified by'))
    80 
    82 
    81   # TODO: some sort of access control preferences are needed at this basic
    83   # TODO: some sort of access control preferences are needed at this basic
    82   #   level.  Works need to be restrict-able to:
    84   #   level.  Works need to be restrict-able to:
    83   #    * the authors only
    85   #    * the authors only
    84   #    * the administrators of the Groups that the authors are in
    86   #    * the administrators of the Groups that the authors are in