changeset 16:5f492a6fbdd1

add note about URL structure
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 24 May 2010 07:28:39 -0700
parents 1701e5b0b0eb
children c85d42296c06
files taginthemiddle/handlers.py
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/taginthemiddle/handlers.py
+++ b/taginthemiddle/handlers.py
@@ -80,17 +80,31 @@ class TagCloud(GenshiHandler):
         if request.path_info.endswith('/%s' % app.tags_url):
             try:
                 return cls(app, request)
             except HandlerMatchException:
                 return None
 
 
 class ViewTags(GenshiHandler):
-    # TODO: RSS
+    """
+    View for tags on a resource;  for app.tags_url == 'tags':
+
+    /<resource>/tags/mozilla :
+    all paths under /<resource> tagged with 'mozilla'
+
+    /<resource>/tags/mozilla+workflow :
+    all paths under /<resource> tagged with 'mozilla' and 'workflow'
+    (or should it be /<resource>/tags/mozilla/workflow , which would be
+    identical to /<resource>/tags/workflow/mozilla ?)
+
+    Also handles RSS:
+    /<resource>/tags/mozilla?format=rss
+    """
+    
     template = 'tags.html'
     methods = set(['GET'])
 
     def __init__(self, app, request):
         GenshiHandler.__init__(self, app, request)
         path = request.path_info.split('/')
         try:
             index = path.index(app.tags_url)
@@ -98,16 +112,17 @@ class ViewTags(GenshiHandler):
             raise HandlerMatchException
         self.tags = path[index+1:]
         if not self.tags:
             raise HandlerMatchException
         self.data['tags'] = self.tags
 
     @classmethod
     def match(cls, app, request):
+
         # check the method
         if request.method not in cls.methods:
             return None
 
         try:
             return cls(app, request)
         except HandlerMatchException:
             return None