|
a/Allura/allura/model/index.py |
|
b/Allura/allura/model/index.py |
|
... |
|
... |
34 |
Field('references', [str], index=True))
|
34 |
Field('references', [str], index=True))
|
35 |
|
35 |
|
36 |
ShortlinkDoc = collection(
|
36 |
ShortlinkDoc = collection(
|
37 |
'shortlink', main_doc_session,
|
37 |
'shortlink', main_doc_session,
|
38 |
Field('_id', S.ObjectId()),
|
38 |
Field('_id', S.ObjectId()),
|
39 |
Field('ref_id', str, index=True),
|
39 |
Field('ref_id', str, index=True), # index needed for from_artifact() and index_tasks.py:del_artifacts
|
40 |
Field('project_id', S.ObjectId()),
|
40 |
Field('project_id', S.ObjectId()),
|
41 |
Field('app_config_id', S.ObjectId()),
|
41 |
Field('app_config_id', S.ObjectId()),
|
42 |
Field('link', str),
|
42 |
Field('link', str),
|
43 |
Field('url', str),
|
43 |
Field('url', str),
|
44 |
Index('link', 'project_id', 'app_config_id'))
|
44 |
Index('project_id', 'link'), # used by from_links() More helpful to have project_id first, for other queries
|
|
|
45 |
)
|
45 |
|
46 |
|
46 |
# Class definitions
|
47 |
# Class definitions
|
47 |
class ArtifactReference(object):
|
48 |
class ArtifactReference(object):
|
48 |
|
49 |
|
49 |
@classmethod
|
50 |
@classmethod
|
|
... |
|
... |
149 |
result = {}
|
150 |
result = {}
|
150 |
for link, d in parsed_links.iteritems():
|
151 |
for link, d in parsed_links.iteritems():
|
151 |
matches = matches_by_artifact.get(unquote(d['artifact']), [])
|
152 |
matches = matches_by_artifact.get(unquote(d['artifact']), [])
|
152 |
matches = (
|
153 |
matches = (
|
153 |
m for m in matches
|
154 |
m for m in matches
|
154 |
if m.project.shortname == d['project'] and
|
155 |
if m.project.shortname == d['project'] and
|
155 |
m.project.neighborhood_id == d['nbhd'] and
|
156 |
m.project.neighborhood_id == d['nbhd'] and
|
156 |
m.app_config is not None and
|
157 |
m.app_config is not None and
|
157 |
m.project.app_instance(m.app_config.options.mount_point))
|
158 |
m.project.app_instance(m.app_config.options.mount_point))
|
158 |
if d['app']:
|
159 |
if d['app']:
|
159 |
matches = (
|
160 |
matches = (
|
160 |
m for m in matches
|
161 |
m for m in matches
|