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 ...@@ -280,7 +280,7 @@ When your forms contain foreign keys, have those **related models loaded via aja
form_ajax_refs = { form_ajax_refs = {
'user': { 'user': {
'fields': ['first_name', 'last_name', 'email'] 'fields': ['first_name', 'last_name', 'email'],
'page_size': 10 'page_size': 10
} }
} }
...@@ -342,7 +342,7 @@ For this you could override only the view in question, and all the links to it w ...@@ -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 # Flask and Flask-SQLAlchemy initialization here
class UserView(ModelView): class UserView(ModelView):
@expose('/new/', methods=('GET', 'POST')) @expose('/new/', methods=('GET', 'POST'))
def create_view(self): def create_view(self):
""" """
Custom create view. Custom create view.
...@@ -474,7 +474,7 @@ To generate the URL for a specific view, use *url_for* with a dot prefix:: ...@@ -474,7 +474,7 @@ To generate the URL for a specific view, use *url_for* with a dot prefix::
class MyView(BaseView): class MyView(BaseView):
@expose('/') @expose('/')
def index(self) def index(self):
# Get URL for the test view method # Get URL for the test view method
user_list_url = url_for('user.index_view') user_list_url = url_for('user.index_view')
return self.render('index.html', user_list_url=user_list_url) 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:: ...@@ -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:: If your view endpoint was defined like::
admin.add_view(CustomView(name='Analytics', endpoint='analytics')) admin.add_view(CustomView(name='Analytics', endpoint='analytics'))
\ No newline at end of file
...@@ -513,7 +513,7 @@ class BaseModelView(BaseView, ActionsMixin): ...@@ -513,7 +513,7 @@ class BaseModelView(BaseView, ActionsMixin):
class MyModelView(BaseModelView): class MyModelView(BaseModelView):
form_ajax_refs = { form_ajax_refs = {
'user': { 'user': {
'fields': ('first_name', 'last_name', 'email') 'fields': ('first_name', 'last_name', 'email'),
'page_size': 10 '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