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
7585da1d
Commit
7585da1d
authored
Jul 25, 2015
by
Petrus Janse van Rensburg
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #960 from plaes/doc-fixes
Various minor documentation fixes
parents
201fd37d
e4c04cbe
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
34 additions
and
37 deletions
+34
-37
mod_actions.rst
doc/api/mod_actions.rst
+1
-1
mod_base.rst
doc/api/mod_base.rst
+1
-1
mod_contrib_fileadmin.rst
doc/api/mod_contrib_fileadmin.rst
+1
-1
mod_contrib_mongoengine.rst
doc/api/mod_contrib_mongoengine.rst
+1
-1
mod_contrib_mongoengine_fields.rst
doc/api/mod_contrib_mongoengine_fields.rst
+1
-1
mod_contrib_peewee.rst
doc/api/mod_contrib_peewee.rst
+1
-1
mod_contrib_pymongo.rst
doc/api/mod_contrib_pymongo.rst
+1
-1
mod_contrib_sqla.rst
doc/api/mod_contrib_sqla.rst
+1
-1
mod_form.rst
doc/api/mod_form.rst
+1
-1
mod_form_upload.rst
doc/api/mod_form_upload.rst
+1
-4
mod_helpers.rst
doc/api/mod_helpers.rst
+1
-1
mod_model.rst
doc/api/mod_model.rst
+1
-1
mod_model_template.rst
doc/api/mod_model_template.rst
+1
-1
mod_tools.rst
doc/api/mod_tools.rst
+1
-1
introduction.rst
doc/introduction.rst
+4
-4
view.py
flask_admin/contrib/sqla/view.py
+15
-15
base.py
flask_admin/model/base.py
+1
-1
No files found.
doc/api/mod_actions.rst
View file @
7585da1d
``flask_admin.actions``
``flask_admin.actions``
=======================
====
=======================
.. automodule:: flask_admin.actions
.. automodule:: flask_admin.actions
...
...
doc/api/mod_base.rst
View file @
7585da1d
``flask_admin.base``
``flask_admin.base``
====================
====
====================
.. automodule:: flask_admin.base
.. automodule:: flask_admin.base
...
...
doc/api/mod_contrib_fileadmin.rst
View file @
7585da1d
``flask_admin.contrib.fileadmin``
``flask_admin.contrib.fileadmin``
=================================
====
=================================
.. automodule:: flask_admin.contrib.fileadmin
.. automodule:: flask_admin.contrib.fileadmin
...
...
doc/api/mod_contrib_mongoengine.rst
View file @
7585da1d
``flask_admin.contrib.mongoengine``
``flask_admin.contrib.mongoengine``
===================================
====
===================================
MongoEngine model backend implementation.
MongoEngine model backend implementation.
...
...
doc/api/mod_contrib_mongoengine_fields.rst
View file @
7585da1d
``flask_admin.contrib.mongoengine.fields``
``flask_admin.contrib.mongoengine.fields``
==========================================
====
==========================================
.. automodule:: flask_admin.contrib.mongoengine.fields
.. automodule:: flask_admin.contrib.mongoengine.fields
...
...
doc/api/mod_contrib_peewee.rst
View file @
7585da1d
``flask_admin.contrib.peewee``
``flask_admin.contrib.peewee``
==============================
====
==============================
Peewee model backend implementation.
Peewee model backend implementation.
...
...
doc/api/mod_contrib_pymongo.rst
View file @
7585da1d
``flask_admin.contrib.pymongo``
``flask_admin.contrib.pymongo``
===============================
====
===============================
PyMongo model backend implementation.
PyMongo model backend implementation.
...
...
doc/api/mod_contrib_sqla.rst
View file @
7585da1d
``flask_admin.contrib.sqla``
``flask_admin.contrib.sqla``
============================
====
============================
SQLAlchemy model backend implementation.
SQLAlchemy model backend implementation.
...
...
doc/api/mod_form.rst
View file @
7585da1d
``flask_admin.form``
``flask_admin.form``
====================
====
====================
.. automodule:: flask_admin.form
.. automodule:: flask_admin.form
...
...
doc/api/mod_form_upload.rst
View file @
7585da1d
``flask_admin.form.upload``
``flask_admin.form.upload``
===========================
====
===========================
.. automodule:: flask_admin.form.upload
.. automodule:: flask_admin.form.upload
...
@@ -10,7 +10,4 @@
...
@@ -10,7 +10,4 @@
:members: __init__
:members: __init__
.. autoclass:: FileUploadInput
.. autoclass:: FileUploadInput
:members: __init__
.. autoclass:: ImageUploadInput
.. autoclass:: ImageUploadInput
:members: __init__
doc/api/mod_helpers.rst
View file @
7585da1d
``flask_admin.helpers``
``flask_admin.helpers``
=======================
====
=======================
.. automodule:: flask_admin.helpers
.. automodule:: flask_admin.helpers
...
...
doc/api/mod_model.rst
View file @
7585da1d
``flask_admin.model``
``flask_admin.model``
=====================
====
=====================
.. automodule:: flask_admin.model
.. automodule:: flask_admin.model
...
...
doc/api/mod_model_template.rst
View file @
7585da1d
``flask_admin.model.template``
``flask_admin.model.template``
==============================
====
==============================
.. automodule:: flask_admin.model.template
.. automodule:: flask_admin.model.template
...
...
doc/api/mod_tools.rst
View file @
7585da1d
``flask_admin.tools``
``flask_admin.tools``
=====================
====
=====================
.. automodule:: flask_admin.tools
.. automodule:: flask_admin.tools
...
...
doc/introduction.rst
View file @
7585da1d
...
@@ -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/contrib/sqla/view.py
View file @
7585da1d
...
@@ -96,19 +96,19 @@ class ModelView(BaseModelView):
...
@@ -96,19 +96,19 @@ class ModelView(BaseModelView):
The following search rules apply:
The following search rules apply:
- If you enter
*ZZZ* in the UI search field, it will generate *ILIKE '
%
ZZZ
%
'*
- If you enter
``ZZZ`` in the UI search field, it will generate ``ILIKE '
%
ZZZ
%
'``
statement against searchable columns.
statement against searchable columns.
- If you enter multiple words, each word will be searched separately, but
- If you enter multiple words, each word will be searched separately, but
only rows that contain all words will be displayed. For example, searching
only rows that contain all words will be displayed. For example, searching
for
'abc def' will find all rows that contain 'abc' and 'def'
in one or
for
``abc def`` will find all rows that contain ``abc`` and ``def``
in one or
more columns.
more columns.
- If you prefix your search term with
^
, it will find all rows
- If you prefix your search term with
``^``
, it will find all rows
that start with
^. So, if you entered *^ZZZ*, *ILIKE 'ZZZ
%
'*
will be used.
that start with
``^``. So, if you entered ``^ZZZ`` then ``ILIKE 'ZZZ
%
'``
will be used.
- If you prefix your search term with
=
, it will perform an exact match.
- If you prefix your search term with
``=``
, it will perform an exact match.
For example, if you entered
*=ZZZ*, the statement *ILIKE 'ZZZ'*
will be used.
For example, if you entered
``=ZZZ``, the statement ``ILIKE 'ZZZ'``
will be used.
"""
"""
column_filters
=
None
column_filters
=
None
...
@@ -170,9 +170,9 @@ class ModelView(BaseModelView):
...
@@ -170,9 +170,9 @@ class ModelView(BaseModelView):
giving SQLAlchemy a chance to manually cleanup any dependencies (many-to-many
giving SQLAlchemy a chance to manually cleanup any dependencies (many-to-many
relationships, etc).
relationships, etc).
If set to `True`, will run a `
DELETE
` statement which is somewhat faster,
If set to `True`, will run a `
`DELETE`
` statement which is somewhat faster,
but may leave corrupted data if you forget to configure `DELETE
but may leave corrupted data if you forget to configure `
`
DELETE
CASCADE` for your model.
CASCADE`
`
for your model.
"""
"""
inline_models
=
None
inline_models
=
None
...
@@ -201,12 +201,12 @@ class ModelView(BaseModelView):
...
@@ -201,12 +201,12 @@ class ModelView(BaseModelView):
You can customize the generated field name by:
You can customize the generated field name by:
1. Using the `form_name` property as a key to the options dictionary:
1. Using the `form_name` property as a key to the options dictionary:
:
class MyModelView(ModelView):
class MyModelView(ModelView):
inline_models = ((Post, dict(form_label='Hello')))
inline_models = ((Post, dict(form_label='Hello')))
2. Using forward relation name and `column_labels` property:
2. Using forward relation name and `column_labels` property:
:
class Model1(Base):
class Model1(Base):
pass
pass
...
@@ -231,7 +231,7 @@ class ModelView(BaseModelView):
...
@@ -231,7 +231,7 @@ class ModelView(BaseModelView):
class MyModelView(BaseModelView):
class MyModelView(BaseModelView):
form_choices = {'my_form_field': [
form_choices = {'my_form_field': [
('db_value', 'display_value'),
('db_value', 'display_value'),
]
]
}
"""
"""
form_optional_types
=
(
Boolean
,)
form_optional_types
=
(
Boolean
,)
...
@@ -732,10 +732,10 @@ class ModelView(BaseModelView):
...
@@ -732,10 +732,10 @@ class ModelView(BaseModelView):
"""
"""
Return a the count query for the model type
Return a the count query for the model type
A
query(self.model).count()
approach produces an excessive
A
``query(self.model).count()``
approach produces an excessive
subquery, so
query(func.count('*'))
should be used instead.
subquery, so
``query(func.count('*'))``
should be used instead.
See
#45a2723 commit message
for details.
See
commit ``#45a2723``
for details.
"""
"""
return
self
.
session
.
query
(
func
.
count
(
'*'
))
.
select_from
(
self
.
model
)
return
self
.
session
.
query
(
func
.
count
(
'*'
))
.
select_from
(
self
.
model
)
...
...
flask_admin/model/base.py
View file @
7585da1d
...
@@ -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