app/soc/models/notification.py
changeset 824 e964dca75527
parent 756 a0c0b48563cb
child 970 8b5611d5b053
equal deleted inserted replaced
823:c11a103f103d 824:e964dca75527
     3 # Copyright 2008 the Melange authors.
     3 # Copyright 2008 the Melange authors.
     4 #
     4 #
     5 # Licensed under the Apache License, Version 2.0 (the "License");
     5 # Licensed under the Apache License, Version 2.0 (the "License");
     6 # you may not use this file except in compliance with the License.
     6 # you may not use this file except in compliance with the License.
     7 # You may obtain a copy of the License at
     7 # You may obtain a copy of the License at
     8 # 
     8 #
     9 #   http://www.apache.org/licenses/LICENSE-2.0
     9 #   http://www.apache.org/licenses/LICENSE-2.0
    10 # 
    10 #
    11 # Unless required by applicable law or agreed to in writing, software
    11 # Unless required by applicable law or agreed to in writing, software
    12 # distributed under the License is distributed on an "AS IS" BASIS,
    12 # distributed under the License is distributed on an "AS IS" BASIS,
    13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14 # See the License for the specific language governing permissions and
    14 # See the License for the specific language governing permissions and
    15 # limitations under the License.
    15 # limitations under the License.
    37   #: this is a non-required property, None will indicate an Anonymous Admin
    37   #: this is a non-required property, None will indicate an Anonymous Admin
    38   from_user = db.ReferenceProperty(reference_class=soc.models.user.User,
    38   from_user = db.ReferenceProperty(reference_class=soc.models.user.User,
    39       required=False,
    39       required=False,
    40       collection_name="sent_notifications",
    40       collection_name="sent_notifications",
    41       verbose_name=ugettext_lazy('From'))
    41       verbose_name=ugettext_lazy('From'))
    42   
    42 
    43   subject = db.StringProperty(required=True,
    43   subject = db.StringProperty(required=True,
    44       verbose_name=ugettext_lazy('Subject'))
    44       verbose_name=ugettext_lazy('Subject'))
    45   
    45 
    46   #: the message that is contained within this Notification
    46   #: the message that is contained within this Notification
    47   message = db.TextProperty(required=True,
    47   message = db.TextProperty(required=True,
    48       verbose_name=ugettext_lazy('Message'))
    48       verbose_name=ugettext_lazy('Message'))
    49   
    49 
    50   #: date and time on which this Notification was created
    50   #: date and time on which this Notification was created
    51   created_on = db.DateTimeProperty(auto_now_add=True,
    51   created_on = db.DateTimeProperty(auto_now_add=True,
    52       verbose_name=ugettext_lazy('Created On'))
    52       verbose_name=ugettext_lazy('Created On'))
    53   
    53 
    54   #: boolean property that marks if the notification is unread
    54   #: boolean property that marks if the notification is unread
    55   unread = db.BooleanProperty(default=True,
    55   unread = db.BooleanProperty(default=True,
    56       verbose_name=ugettext_lazy('Unread'))
    56       verbose_name=ugettext_lazy('Unread'))