Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
flask-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
flask-admin
Commits
a667a9c0
Commit
a667a9c0
authored
Jul 25, 2015
by
Priit Laes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix syntax errors in example code snippets
parent
201fd37d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
introduction.rst
doc/introduction.rst
+4
-4
base.py
flask_admin/model/base.py
+1
-1
No files found.
doc/introduction.rst
View file @
a667a9c0
...
@@ -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
flask_admin/model/base.py
View file @
a667a9c0
...
@@ -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
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment