|
a/Allura/allura/model/artifact.py |
|
b/Allura/allura/model/artifact.py |
|
... |
|
... |
52 |
|
52 |
|
53 |
- Automatically indexed into Solr (see index() method)
|
53 |
- Automatically indexed into Solr (see index() method)
|
54 |
- Has a discussion thread that can have files attached to it
|
54 |
- Has a discussion thread that can have files attached to it
|
55 |
|
55 |
|
56 |
:var mod_date: last-modified :class:`datetime`
|
56 |
:var mod_date: last-modified :class:`datetime`
|
57 |
:var tool_version: defaults to the parent Application's version
|
|
|
58 |
:var acl: dict of permission name => [roles]
|
57 |
:var acl: dict of permission name => [roles]
|
59 |
:var labels: list of plain old strings
|
58 |
:var labels: list of plain old strings
|
60 |
|
59 |
|
61 |
"""
|
60 |
"""
|
62 |
class __mongometa__:
|
61 |
class __mongometa__:
|
|
... |
|
... |
75 |
# Artifact base schema
|
74 |
# Artifact base schema
|
76 |
_id = FieldProperty(S.ObjectId)
|
75 |
_id = FieldProperty(S.ObjectId)
|
77 |
mod_date = FieldProperty(datetime, if_missing=datetime.utcnow)
|
76 |
mod_date = FieldProperty(datetime, if_missing=datetime.utcnow)
|
78 |
app_config_id = ForeignIdProperty('AppConfig', if_missing=lambda:c.app.config._id)
|
77 |
app_config_id = ForeignIdProperty('AppConfig', if_missing=lambda:c.app.config._id)
|
79 |
plugin_verson = FieldProperty(S.Deprecated)
|
78 |
plugin_verson = FieldProperty(S.Deprecated)
|
80 |
tool_version = FieldProperty(
|
79 |
tool_version = FieldProperty(S.Deprecated)
|
81 |
{ str: str },
|
|
|
82 |
if_missing=lambda:{c.app.config.tool_name:c.app.__version__})
|
|
|
83 |
acl = FieldProperty(ACL)
|
80 |
acl = FieldProperty(ACL)
|
84 |
tags = FieldProperty(S.Deprecated)
|
81 |
tags = FieldProperty(S.Deprecated)
|
85 |
labels = FieldProperty([str])
|
82 |
labels = FieldProperty([str])
|
86 |
references = FieldProperty(S.Deprecated)
|
83 |
references = FieldProperty(S.Deprecated)
|
87 |
backreferences = FieldProperty(S.Deprecated)
|
84 |
backreferences = FieldProperty(S.Deprecated)
|
|
... |
|
... |
366 |
from .discuss import Thread
|
363 |
from .discuss import Thread
|
367 |
t = Thread.query.get(ref_id=self.index_id())
|
364 |
t = Thread.query.get(ref_id=self.index_id())
|
368 |
if t is None:
|
365 |
if t is None:
|
369 |
idx = self.index()
|
366 |
idx = self.index()
|
370 |
t = Thread.new(
|
367 |
t = Thread.new(
|
|
|
368 |
app_config_id=self.app_config_id,
|
371 |
discussion_id=self.app_config.discussion_id,
|
369 |
discussion_id=self.app_config.discussion_id,
|
372 |
ref_id=idx['id'],
|
370 |
ref_id=idx['id'],
|
373 |
subject='%s discussion' % h.get_first(idx, 'title'))
|
371 |
subject='%s discussion' % h.get_first(idx, 'title'))
|
374 |
parent_id = None
|
372 |
parent_id = None
|
375 |
if data:
|
373 |
if data:
|