author | Lennard de Rijk <ljvderijk@gmail.com> |
Sat, 10 Jan 2009 13:28:04 +0000 | |
changeset 794 | 19c24508c398 |
parent 756 | a0c0b48563cb |
child 824 | e964dca75527 |
permissions | -rw-r--r-- |
726 | 1 |
#!/usr/bin/python2.5 |
2 |
# |
|
3 |
# Copyright 2008 the Melange authors. |
|
4 |
# |
|
5 |
# Licensed under the Apache License, Version 2.0 (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 |
|
8 |
# |
|
9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
|
10 |
# |
|
11 |
# Unless required by applicable law or agreed to in writing, software |
|
12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
|
13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
14 |
# See the License for the specific language governing permissions and |
|
15 |
# limitations under the License. |
|
16 |
||
17 |
"""This module contains the Notification Model. |
|
18 |
""" |
|
19 |
||
20 |
__authors__ = [ |
|
21 |
'"Lennard de Rijk" <ljvderijk@gmail.com>', |
|
22 |
] |
|
23 |
||
24 |
from google.appengine.ext import db |
|
25 |
||
26 |
from django.utils.translation import ugettext_lazy |
|
27 |
||
28 |
import soc.models.linkable |
|
29 |
import soc.models.user |
|
30 |
||
31 |
||
32 |
class Notification(soc.models.linkable.Linkable): |
|
33 |
"""Model of a Notification. |
|
34 |
""" |
|
35 |
||
748
f00e6b3af5a6
Remove unused imports in models modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
737
diff
changeset
|
36 |
#: a reference to the user this Notification is from |
f00e6b3af5a6
Remove unused imports in models modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
737
diff
changeset
|
37 |
#: this is a non-required property, None will indicate an Anonymous Admin |
726 | 38 |
from_user = db.ReferenceProperty(reference_class=soc.models.user.User, |
39 |
required=False, |
|
40 |
collection_name="sent_notifications", |
|
756
a0c0b48563cb
Changed invitation email and into a notification.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
748
diff
changeset
|
41 |
verbose_name=ugettext_lazy('From')) |
726 | 42 |
|
43 |
subject = db.StringProperty(required=True, |
|
44 |
verbose_name=ugettext_lazy('Subject')) |
|
45 |
||
748
f00e6b3af5a6
Remove unused imports in models modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
737
diff
changeset
|
46 |
#: the message that is contained within this Notification |
726 | 47 |
message = db.TextProperty(required=True, |
48 |
verbose_name=ugettext_lazy('Message')) |
|
49 |
||
748
f00e6b3af5a6
Remove unused imports in models modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
737
diff
changeset
|
50 |
#: date and time on which this Notification was created |
726 | 51 |
created_on = db.DateTimeProperty(auto_now_add=True, |
52 |
verbose_name=ugettext_lazy('Created On')) |
|
53 |
||
748
f00e6b3af5a6
Remove unused imports in models modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
737
diff
changeset
|
54 |
#: boolean property that marks if the notification is unread |
737
4c78ee183eb6
Notification property has_been_read changed into unread
Lennard de Rijk <ljvderijk@gmail.com>
parents:
726
diff
changeset
|
55 |
unread = db.BooleanProperty(default=True, |
4c78ee183eb6
Notification property has_been_read changed into unread
Lennard de Rijk <ljvderijk@gmail.com>
parents:
726
diff
changeset
|
56 |
verbose_name=ugettext_lazy('Unread')) |