Commit a667a9c0 authored by Priit Laes's avatar Priit Laes

Fix syntax errors in example code snippets

parent 201fd37d
......@@ -280,7 +280,7 @@ When your forms contain foreign keys, have those **related models loaded via aja
form_ajax_refs = {
'user': {
'fields': ['first_name', 'last_name', 'email']
'fields': ['first_name', 'last_name', 'email'],
'page_size': 10
}
}
......@@ -342,7 +342,7 @@ For this you could override only the view in question, and all the links to it w
# Flask and Flask-SQLAlchemy initialization here
class UserView(ModelView):
@expose('/new/', methods=('GET', 'POST'))
@expose('/new/', methods=('GET', 'POST'))
def create_view(self):
"""
Custom create view.
......@@ -474,7 +474,7 @@ To generate the URL for a specific view, use *url_for* with a dot prefix::
class MyView(BaseView):
@expose('/')
def index(self)
def index(self):
# Get URL for the test view method
user_list_url = url_for('user.index_view')
return self.render('index.html', user_list_url=user_list_url)
......@@ -492,4 +492,4 @@ unique endpoint for each, and using that as the prefix. So, you could use::
If your view endpoint was defined like::
admin.add_view(CustomView(name='Analytics', endpoint='analytics'))
\ No newline at end of file
admin.add_view(CustomView(name='Analytics', endpoint='analytics'))
......@@ -513,7 +513,7 @@ class BaseModelView(BaseView, ActionsMixin):
class MyModelView(BaseModelView):
form_ajax_refs = {
'user': {
'fields': ('first_name', 'last_name', 'email')
'fields': ('first_name', 'last_name', 'email'),
'page_size': 10
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment