[csw-devel] SF.net SVN: gar:[13236] csw/mgar/gar/v2/lib/web/pkgdb_web.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Tue Feb 8 19:58:05 CET 2011


Revision: 13236
          http://gar.svn.sourceforge.net/gar/?rev=13236&view=rev
Author:   wahwah
Date:     2011-02-08 18:58:05 +0000 (Tue, 08 Feb 2011)

Log Message:
-----------
pkgdb-web: Sort error tags by srv4 basename

Sort by srv4 basename, and by tag_info.  Also, only display registered
packages.

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/web/pkgdb_web.py

Modified: csw/mgar/gar/v2/lib/web/pkgdb_web.py
===================================================================
--- csw/mgar/gar/v2/lib/web/pkgdb_web.py	2011-02-08 18:57:27 UTC (rev 13235)
+++ csw/mgar/gar/v2/lib/web/pkgdb_web.py	2011-02-08 18:58:05 UTC (rev 13236)
@@ -195,8 +195,19 @@
 class ErrorTagDetail(object):
   def GET(self, tag_name):
     ConnectToDatabase()
-    # TODO: Select only tags of registered packages
-    tags = models.CheckpkgErrorTag.selectBy(tag_name=tag_name)
+    join = [
+        sqlbuilder.INNERJOINOn(None,
+          models.Srv4FileStats,
+          models.CheckpkgErrorTag.q.srv4_file==models.Srv4FileStats.q.id),
+    ]
+    tags = models.CheckpkgErrorTag.select(
+        sqlobject.AND(
+          models.CheckpkgErrorTag.q.tag_name==tag_name,
+          models.Srv4FileStats.q.registered==True,
+          models.Srv4FileStats.q.use_to_generate_catalogs==True,
+          ),
+        join=join,
+    ).orderBy(('basename', 'tag_info'))
     return render.ErrorTagDetail(tag_name, tags)
 
 class ErrorTagList(object):


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list