I have some URL patterns like this in webapp.WSGIApplication:
(r'/myconfigs', MyConfigsHandler),
(r'/myconfigs/(.*)', MyConfigsHandler), # action
(r'/myconfigs/(.*)/(.*)', MyConfigsHandler), # action, config_id
(r'/myconfigs/(.*)/(.*)/(.*)', MyConfigsHandler), # action, config_id,
sub_item
(r'/myconfigs/(.*)/(.*)/(.*)/(.*)', MyConfigsHandler), # action,
config_id, sub_item, sub_action
(r'/myconfigs/(.*)/(.*)/(.*)/(.*)/(.*)', MyConfigsHandler) # action,
config_id, sub_item, sub_action, sub_item_id
MyConfigsHandler is setup like this:
class MyConfigsHandler(BaseRequestHandler):
# /myconfigs/action/config_id/sub_item/sub_action/sub_item_id
# ex: /myconfigs/view/12/partitions/edit/2
def get(self, action='list', config_id=None, sub_item=None,
sub_action='list', sub_item_id=None):
template_values = {
'config_id': config_id,
'sub_item_id': sub_item_id
}
if not sub_item:
self.generate(os.path.join('myconfigs', action +
'.html'),
template_values)
else:
# myconfigs/partitions/edit.html
self.generate(os.path.join('myconfigs', action,
config_id,
sub_item, sub_action + '.html'), template_values)
The problem is, config_id never gets populated when /myconfigs/view/1
is visited. Instead, "action" becomes "view/1" and thus my code is
looking for a template called "1.html". Why isn't the appropriate URL
pattern being used when a config id is specified?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---