Closed krystian566 closed 9 years ago
Realistically you're only going to want to use those decorators when you're wanting to override the template completely (instead of following the existing naming convention) e.g.
from watson.framework.views.decorators import view
class MyClass(object):
@view(template='something/test') # which lives in your view folder
def some_action(self):
pass
or the response format
class MyClass(object):
@view(format='json')
def some_action(self):
return {'some': 'dict'} # then outputted as JSON to the browser
Correct. I have long break. This men thx you. I need to answer faster.
When i write is work:
from watson.framework.views.decorators import view
We really need this why just only write this:from watson.framework import views