def allow_generic(*types):
def _(f,types=types)
for t in types:
response.generic_patterns.append(f.__name__+'.'+t)
return f
return _
@allow_generic('html','json')
def index():
On Aug 7, 11:36 am, encompass <[email protected]> wrote:
> It's too bad we couldn't do it as a decorator or similar. That way we
> could know which pages have the exceptions directly rather than
> opening (or searching) for another file with the correct line.
>
> On Aug 7, 10:13 am, Massimo Di Pierro <[email protected]>
> wrote:
>
>
>
>
>
>
>
> > in models or controllers
>
> > response.generic_patterns=['*']
>
> > will enable them all. They have been disabled because there are some
> > security issues. You may want to be more selective:
>
> > response.generic_patterns=['myactions.json', '.html']
>
> > On Aug 7, 2:06 am, Jason Brower <[email protected]> wrote:
>
> > > I just realised my generic view is not loading. I get:
>
> > > invalid view (default/events.html)
>
> > > When I get rid of events.html in the default folder.
> > > I do have the original generic.html but it still doesn't work. Any
> > > reasons why this would happen?
> > > BR,
> > > Jason Brower