Skip to content

Instantly share code, notes, and snippets.

@zindel
Created May 23, 2016 13:36
Show Gist options
  • Save zindel/657fbc805cdcc56444137ad4803ab206 to your computer and use it in GitHub Desktop.
Save zindel/657fbc805cdcc56444137ad4803ab206 to your computer and use it in GitHub Desktop.
class HandleTable(HandleLocation):
PREFIX = '/table/'
path = '%s**' % PREFIX
def __call__(self, req):
req.path_info_pop()
table = req.path_info_pop()
wizard = get_wizard(table)
if wizard is None:
raise HTTPNotFound("table '%s' not found" % table)
segment = req.path_info_peek()
if segment == '@@':
req.path_info_pop()
if req.path_info.startswith('/'):
req.path_info = req.path_info[1:]
print 'script name', req.script_name
print 'Path', req.path_info
return render_widget(wizard, req)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment