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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Sat Sep 14 17:37:41 CEST 2013


Revision: 21927
          http://gar.svn.sourceforge.net/gar/?rev=21927&view=rev
Author:   wahwah
Date:     2013-09-14 15:37:41 +0000 (Sat, 14 Sep 2013)
Log Message:
-----------
pkgdb-web: Endpoint to look up maints by email

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	2013-09-14 15:37:29 UTC (rev 21926)
+++ csw/mgar/gar/v2/lib/web/pkgdb_web.py	2013-09-14 15:37:41 UTC (rev 21927)
@@ -58,6 +58,7 @@
   r'/rest/catalogs/([^/]+)/(sparc|i386)/(SunOS[^/]+)/pkgnames/([^/]+)/',
       'Srv4ByCatAndPkgname',
   r'/rest/maintainers/', 'RestMaintainerList',
+  r'/rest/maintainers/by-email/', 'RestMaintainerDetailByName', # with ?email=...
   r'/rest/maintainers/([0-9]+)/', 'RestMaintainerDetail',
   r'/rest/srv4/([0-9a-f]{32})/', 'RestSrv4Detail',
   r'/rest/srv4/([0-9a-f]{32})/files/', 'RestSrv4DetailFiles',
@@ -272,6 +273,18 @@
     return cjson.encode(maintainer.GetRestRepr())
 
 
+class RestMaintainerDetailByName(object):
+
+  def GET(self):
+    user_data = web.input()
+    email = user_data.email
+    try:
+      maintainer = models.Maintainer.selectBy(email=email).getOne()
+      return cjson.encode(maintainer.GetRestRepr())
+    except sqlobject.main.SQLObjectNotFound:
+      raise web.notfound()
+
+
 class MaintainerCheckpkgReport(object):
   def GET(self, id):
     maintainer = models.Maintainer.selectBy(id=id).getOne()

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