Commit 7585da1d authored by Petrus Janse van Rensburg's avatar Petrus Janse van Rensburg

Merge pull request #960 from plaes/doc-fixes

Various minor documentation fixes
parents 201fd37d e4c04cbe
``flask_admin.actions`` ``flask_admin.actions``
=========================== =======================
.. automodule:: flask_admin.actions .. automodule:: flask_admin.actions
......
``flask_admin.base`` ``flask_admin.base``
======================== ====================
.. automodule:: flask_admin.base .. automodule:: flask_admin.base
......
``flask_admin.contrib.fileadmin`` ``flask_admin.contrib.fileadmin``
===================================== =================================
.. automodule:: flask_admin.contrib.fileadmin .. automodule:: flask_admin.contrib.fileadmin
......
``flask_admin.contrib.mongoengine`` ``flask_admin.contrib.mongoengine``
======================================= ===================================
MongoEngine model backend implementation. MongoEngine model backend implementation.
......
``flask_admin.contrib.mongoengine.fields`` ``flask_admin.contrib.mongoengine.fields``
============================================== ==========================================
.. automodule:: flask_admin.contrib.mongoengine.fields .. automodule:: flask_admin.contrib.mongoengine.fields
......
``flask_admin.contrib.peewee`` ``flask_admin.contrib.peewee``
================================== ==============================
Peewee model backend implementation. Peewee model backend implementation.
......
``flask_admin.contrib.pymongo`` ``flask_admin.contrib.pymongo``
=================================== ===============================
PyMongo model backend implementation. PyMongo model backend implementation.
......
``flask_admin.contrib.sqla`` ``flask_admin.contrib.sqla``
================================ ============================
SQLAlchemy model backend implementation. SQLAlchemy model backend implementation.
......
``flask_admin.form`` ``flask_admin.form``
======================== ====================
.. automodule:: flask_admin.form .. automodule:: flask_admin.form
......
``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__
``flask_admin.helpers`` ``flask_admin.helpers``
=========================== =======================
.. automodule:: flask_admin.helpers .. automodule:: flask_admin.helpers
......
``flask_admin.model`` ``flask_admin.model``
========================= =====================
.. automodule:: flask_admin.model .. automodule:: flask_admin.model
......
``flask_admin.model.template`` ``flask_admin.model.template``
================================== ==============================
.. automodule:: flask_admin.model.template .. automodule:: flask_admin.model.template
......
``flask_admin.tools`` ``flask_admin.tools``
========================= =====================
.. automodule:: flask_admin.tools .. automodule:: flask_admin.tools
......
...@@ -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
...@@ -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)
......
...@@ -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