|
a/Allura/allura/model/artifact.py |
|
b/Allura/allura/model/artifact.py |
|
... |
|
... |
268 |
|
268 |
|
269 |
class Artifact(MappedClass):
|
269 |
class Artifact(MappedClass):
|
270 |
class __mongometa__:
|
270 |
class __mongometa__:
|
271 |
session = artifact_orm_session
|
271 |
session = artifact_orm_session
|
272 |
name='artifact'
|
272 |
name='artifact'
|
|
|
273 |
indexes = [ 'app_config_id' ]
|
273 |
def before_save(data):
|
274 |
def before_save(data):
|
274 |
data['mod_date'] = datetime.utcnow()
|
275 |
data['mod_date'] = datetime.utcnow()
|
275 |
if c.project:
|
276 |
if c.project:
|
276 |
c.project.last_updated = datetime.utcnow()
|
277 |
c.project.last_updated = datetime.utcnow()
|
277 |
type_s = 'Generic Artifact'
|
278 |
type_s = 'Generic Artifact'
|
|
... |
|
... |
545 |
|
546 |
|
546 |
class Message(Artifact):
|
547 |
class Message(Artifact):
|
547 |
class __mongometa__:
|
548 |
class __mongometa__:
|
548 |
session = artifact_orm_session
|
549 |
session = artifact_orm_session
|
549 |
name='message'
|
550 |
name='message'
|
550 |
indexes = [ 'slug', 'parent_id' ]
|
551 |
indexes = Artifact.__mongometa__.indexes + [ 'slug', 'parent_id', 'timestamp' ]
|
551 |
type_s='Generic Message'
|
552 |
type_s='Generic Message'
|
552 |
|
553 |
|
553 |
_id=FieldProperty(str, if_missing=h.gen_message_id)
|
554 |
_id=FieldProperty(str, if_missing=h.gen_message_id)
|
554 |
slug=FieldProperty(str, if_missing=h.nonce)
|
555 |
slug=FieldProperty(str, if_missing=h.nonce)
|
555 |
full_slug=FieldProperty(str, if_missing=None)
|
556 |
full_slug=FieldProperty(str, if_missing=None)
|