• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

Revision1db5cae9d7df90721d82b3afedcce36a4aa480a5 (tree)
Zeit2012-04-20 05:54:23
AutorCory Johns <johnsca@geek...>
CommiterYaroslav Luzin

Log Message

[#4027] Fixed searching discussions and refactor 'deleted' field into Artifact

Signed-off-by: Cory Johns <johnsca@geek.net>

Ändern Zusammenfassung

Diff

--- a/Allura/allura/ext/search/search_main.py
+++ b/Allura/allura/ext/search/search_main.py
@@ -58,7 +58,7 @@ class SearchController(BaseController):
5858 project_match = ' OR '.join(
5959 'project_id_s:%s' % pid
6060 for pid in pids )
61- search_query = '%s AND is_history_b:%s AND (%s)' % (
61+ search_query = '%s AND is_history_b:%s AND (%s) AND -deleted_b:true' % (
6262 q, history, project_match)
6363 results = search.search(search_query, is_history_b=history)
6464 if results: count=results.hits
--- a/Allura/allura/model/artifact.py
+++ b/Allura/allura/model/artifact.py
@@ -68,6 +68,7 @@ class Artifact(MappedClass):
6868 app_config = RelationProperty('AppConfig')
6969 # Not null if artifact originated from external import, then API ticket id
7070 import_id = FieldProperty(str, if_missing=None)
71+ deleted=FieldProperty(bool, if_missing=False)
7172
7273 def __json__(self):
7374 return dict(
@@ -219,7 +220,8 @@ class Artifact(MappedClass):
219220 url_s=self.url(),
220221 type_s=self.type_s,
221222 labels_t=' '.join(l for l in self.labels),
222- snippet_s='')
223+ snippet_s='',
224+ deleted_b=self.deleted)
223225
224226 def url(self):
225227 """
--- a/ForgeDiscussion/forgediscussion/controllers/root.py
+++ b/ForgeDiscussion/forgediscussion/controllers/root.py
@@ -136,7 +136,7 @@ class RootController(BaseController):
136136 'is_history_b:%s' % history,
137137 'project_id_s:%s' % c.project._id,
138138 'mount_point_s:%s'% c.app.config.options.mount_point,
139- 'deleted:false'])
139+ '-deleted_b:true'])
140140 if results: count=results.hits
141141 c.search_results = self.W.search_results
142142 return dict(q=q, history=history, results=results or [],
--- a/ForgeDiscussion/forgediscussion/model/forum.py
+++ b/ForgeDiscussion/forgediscussion/model/forum.py
@@ -23,7 +23,6 @@ class Forum(M.Discussion):
2323 parent_id = FieldProperty(schema.ObjectId, if_missing=None)
2424 threads = RelationProperty('ForumThread')
2525 posts = RelationProperty('ForumPost')
26- deleted = FieldProperty(bool, if_missing=False)
2726 members_only = FieldProperty(bool, if_missing=False)
2827 anon_posts = FieldProperty(bool, if_missing=False)
2928 monitoring_email = FieldProperty(str, if_missing=None)
--- a/ForgeWiki/forgewiki/model/wiki.py
+++ b/ForgeWiki/forgewiki/model/wiki.py
@@ -76,7 +76,6 @@ class Page(VersionedArtifact):
7676 title=FieldProperty(str)
7777 text=FieldProperty(schema.String, if_missing='')
7878 viewable_by=FieldProperty([str])
79- deleted=FieldProperty(bool, if_missing=False)
8079 type_s = 'Wiki'
8180
8281 def commit(self):
@@ -130,8 +129,7 @@ class Page(VersionedArtifact):
130129 title_s='WikiPage %s' % self.title,
131130 version_i=self.version,
132131 type_s='WikiPage',
133- text=self.text,
134- deleted_b=self.deleted)
132+ text=self.text)
135133 return result
136134
137135 @property