|
a/Allura/allura/model/notification.py |
|
b/Allura/allura/model/notification.py |
|
... |
|
... |
43 |
|
43 |
|
44 |
class Notification(MappedClass):
|
44 |
class Notification(MappedClass):
|
45 |
class __mongometa__:
|
45 |
class __mongometa__:
|
46 |
session = main_orm_session
|
46 |
session = main_orm_session
|
47 |
name = 'notification'
|
47 |
name = 'notification'
|
|
|
48 |
indexes = [ ('neighborhood_id', 'tool_name', 'pubdate') ]
|
48 |
|
49 |
|
49 |
_id = FieldProperty(str, if_missing=h.gen_message_id)
|
50 |
_id = FieldProperty(str, if_missing=h.gen_message_id)
|
50 |
|
51 |
|
51 |
# Classify notifications
|
52 |
# Classify notifications
|
|
|
53 |
neighborhood_id = ForeignIdProperty('Neighborhood', if_missing=lambda:c.project.neighborhood._id)
|
52 |
project_id = ForeignIdProperty('Project', if_missing=lambda:c.project._id)
|
54 |
project_id = ForeignIdProperty('Project', if_missing=lambda:c.project._id)
|
53 |
app_config_id = ForeignIdProperty('AppConfig', if_missing=lambda:c.app.config._id)
|
55 |
app_config_id = ForeignIdProperty('AppConfig', if_missing=lambda:c.app.config._id)
|
|
|
56 |
tool_name = FieldProperty(str, if_missing=lambda:c.app.config.tool_name)
|
54 |
ref_id = ForeignIdProperty('ArtifactReference')
|
57 |
ref_id = ForeignIdProperty('ArtifactReference')
|
55 |
topic = FieldProperty(str)
|
58 |
topic = FieldProperty(str)
|
56 |
unique_id = FieldProperty(str, if_missing=lambda:h.nonce(40))
|
59 |
unique_id = FieldProperty(str, if_missing=lambda:h.nonce(40))
|
57 |
|
60 |
|
58 |
# Notification Content
|
61 |
# Notification Content
|