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
2df9b610
Commit
2df9b610
authored
Apr 24, 2012
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed admin.ext to admin.contrib
parent
971bea12
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
23 additions
and
23 deletions
+23
-23
mod_ext_fileadmin.rst
doc/mod_ext_fileadmin.rst
+3
-3
mod_ext_sqlamodel.rst
doc/mod_ext_sqlamodel.rst
+3
-3
model_guidelines.rst
doc/model_guidelines.rst
+4
-4
quickstart.rst
doc/quickstart.rst
+4
-4
auth.py
examples/auth/auth.py
+1
-1
simple.py
examples/babel/simple.py
+1
-1
file.py
examples/file/file.py
+1
-1
simple.py
examples/sqla/simple.py
+2
-2
__init__.py
flask_admin/contrib/__init__.py
+0
-0
fileadmin.py
flask_admin/contrib/fileadmin.py
+0
-0
__init__.py
flask_admin/contrib/sqlamodel/__init__.py
+0
-0
filters.py
flask_admin/contrib/sqlamodel/filters.py
+0
-0
form.py
flask_admin/contrib/sqlamodel/form.py
+0
-0
tools.py
flask_admin/contrib/sqlamodel/tools.py
+0
-0
view.py
flask_admin/contrib/sqlamodel/view.py
+2
-2
filters.py
flask_admin/model/filters.py
+1
-1
test_sqlamodel.py
flask_admin/tests/test_sqlamodel.py
+1
-1
No files found.
doc/mod_ext_fileadmin.rst
View file @
2df9b610
``flask.ext.admin.
ext
.fileadmin``
``flask.ext.admin.
contrib
.fileadmin``
=================================
=================================
====
.. automodule:: flask.ext.admin.
ext
.fileadmin
.. automodule:: flask.ext.admin.
contrib
.fileadmin
.. autoclass:: FileAdmin
.. autoclass:: FileAdmin
:members:
:members:
...
...
doc/mod_ext_sqlamodel.rst
View file @
2df9b610
``flask.ext.admin.
ext
.sqlamodel``
``flask.ext.admin.
contrib
.sqlamodel``
=================================
=================================
====
.. automodule:: flask.ext.admin.
ext
.sqlamodel
.. automodule:: flask.ext.admin.
contrib
.sqlamodel
.. autoclass:: ModelView
.. autoclass:: ModelView
:members:
:members:
...
...
doc/model_guidelines.rst
View file @
2df9b610
Adding new model backend
Adding new model backend
========================
========================
If you want to implement new database backend to use with model views, follow steps f
rom
this guideline.
If you want to implement new database backend to use with model views, follow steps f
ound in
this guideline.
There are few assumptions about models:
There are few assumptions about models:
1. Model has "primary key" - value which uniquely identifies
1. Model has "primary key" - value which uniquely identifies
one model in a data store. There's no restriction on the
one model in a data store. There's no restriction on the
data type.
data type
or field name
.
2. Model has readable python properties
2. Model has readable python properties
3. It is possible to get list of models (optionally - sorted,
3. It is possible to get list of models (optionally - sorted,
filtered, etc) from data store
filtered, etc) from data store
...
@@ -30,7 +30,7 @@ Steps to add new model backend:
...
@@ -30,7 +30,7 @@ Steps to add new model backend:
This method will return primary key value from
This method will return primary key value from
the model. For example, in SQLAlchemy backend,
the model. For example, in SQLAlchemy backend,
it gets primary key from the model (:meth:`~flask.ext.admin.
ext
.sqla.ModelView.scaffold_pk), caches it
it gets primary key from the model (:meth:`~flask.ext.admin.
contrib
.sqla.ModelView.scaffold_pk), caches it
and returns actual value from the model from ``get_pk_value`` when requested.
and returns actual value from the model from ``get_pk_value`` when requested.
For example::
For example::
...
@@ -103,7 +103,7 @@ Steps to add new model backend:
...
@@ -103,7 +103,7 @@ Steps to add new model backend:
filtering logic for this filter type.
filtering logic for this filter type.
Lets take SQLAlchemy model backend as an example.
Lets take SQLAlchemy model backend as an example.
All SQLAlchemy filters derive from :class:`~flask.ext.admin.
ext
.sqla.filters.BaseSQLAFilter` class.
All SQLAlchemy filters derive from :class:`~flask.ext.admin.
contrib
.sqla.filters.BaseSQLAFilter` class.
Each filter implements one simple filter SQL operation
Each filter implements one simple filter SQL operation
(like, not like, greater, etc) and accepts column as
(like, not like, greater, etc) and accepts column as
...
...
doc/quickstart.rst
View file @
2df9b610
...
@@ -196,7 +196,7 @@ Model Views
...
@@ -196,7 +196,7 @@ Model Views
Flask-Admin comes with built-in SQLAlchemy model administrative interface. It is very easy to use::
Flask-Admin comes with built-in SQLAlchemy model administrative interface. It is very easy to use::
from flask.ext.admin.
ext
.sqlamodel import ModelView
from flask.ext.admin.
contrib
.sqlamodel import ModelView
from flask.ext.sqlalchemy import db
from flask.ext.sqlalchemy import db
# Flask and Flask-SQLAlchemy initialization here
# Flask and Flask-SQLAlchemy initialization here
...
@@ -236,7 +236,7 @@ you can do something like this::
...
@@ -236,7 +236,7 @@ you can do something like this::
It is very easy to add support for different database backends (Mongo, etc) by inheriting from `BaseModelView`
It is very easy to add support for different database backends (Mongo, etc) by inheriting from `BaseModelView`
class and implementing database-related methods.
class and implementing database-related methods.
Please refer to :mod:`flask.ext.admin.
ext
.sqlamodel` documentation on how to customize behavior of model-based administrative views.
Please refer to :mod:`flask.ext.admin.
contrib
.sqlamodel` documentation on how to customize behavior of model-based administrative views.
File Admin
File Admin
----------
----------
...
@@ -245,7 +245,7 @@ Flask-Admin comes with another handy battery - file admin. It gives you ability
...
@@ -245,7 +245,7 @@ Flask-Admin comes with another handy battery - file admin. It gives you ability
Here is simple example::
Here is simple example::
from flask.ext.admin.
ext
.fileadmin import FileAdmin
from flask.ext.admin.
contrib
.fileadmin import FileAdmin
import os.path as op
import os.path as op
...
@@ -263,7 +263,7 @@ Sample screenshot:
...
@@ -263,7 +263,7 @@ Sample screenshot:
:target: ../_images/quickstart_5.png
:target: ../_images/quickstart_5.png
You can disable uploads, disable file or directory deletion, restrict file uploads to certain types and so on.
You can disable uploads, disable file or directory deletion, restrict file uploads to certain types and so on.
Check :mod:`flask.ext.admin.
ext
.fileadmin` documentation on how to do it.
Check :mod:`flask.ext.admin.
contrib
.fileadmin` documentation on how to do it.
Examples
Examples
--------
--------
...
...
examples/auth/auth.py
View file @
2df9b610
...
@@ -2,7 +2,7 @@ from flask import Flask, url_for, redirect, render_template, request
...
@@ -2,7 +2,7 @@ from flask import Flask, url_for, redirect, render_template, request
from
flaskext.sqlalchemy
import
SQLAlchemy
from
flaskext.sqlalchemy
import
SQLAlchemy
from
flask.ext
import
admin
,
login
,
wtf
from
flask.ext
import
admin
,
login
,
wtf
from
flask.ext.admin.
ext
import
sqlamodel
from
flask.ext.admin.
contrib
import
sqlamodel
# Create application
# Create application
app
=
Flask
(
__name__
)
app
=
Flask
(
__name__
)
...
...
examples/babel/simple.py
View file @
2df9b610
...
@@ -4,7 +4,7 @@ from flaskext.sqlalchemy import SQLAlchemy
...
@@ -4,7 +4,7 @@ from flaskext.sqlalchemy import SQLAlchemy
from
flask.ext
import
admin
from
flask.ext
import
admin
from
flask.ext.babel
import
Babel
from
flask.ext.babel
import
Babel
from
flask.ext.admin.
ext
import
sqlamodel
from
flask.ext.admin.
contrib
import
sqlamodel
# Create application
# Create application
app
=
Flask
(
__name__
)
app
=
Flask
(
__name__
)
...
...
examples/file/file.py
View file @
2df9b610
...
@@ -4,7 +4,7 @@ import os.path as op
...
@@ -4,7 +4,7 @@ import os.path as op
from
flask
import
Flask
from
flask
import
Flask
from
flask.ext
import
admin
from
flask.ext
import
admin
from
flask.ext.admin.
ext
import
fileadmin
from
flask.ext.admin.
contrib
import
fileadmin
# Create flask app
# Create flask app
...
...
examples/sqla/simple.py
View file @
2df9b610
...
@@ -2,8 +2,8 @@ from flask import Flask
...
@@ -2,8 +2,8 @@ from flask import Flask
from
flaskext.sqlalchemy
import
SQLAlchemy
from
flaskext.sqlalchemy
import
SQLAlchemy
from
flask.ext
import
admin
,
wtf
from
flask.ext
import
admin
,
wtf
from
flask.ext.admin.
ext
import
sqlamodel
from
flask.ext.admin.
contrib
import
sqlamodel
from
flask.ext.admin.
ext
.sqlamodel
import
filters
from
flask.ext.admin.
contrib
.sqlamodel
import
filters
# Create application
# Create application
app
=
Flask
(
__name__
)
app
=
Flask
(
__name__
)
...
...
flask_admin/
ext
/__init__.py
→
flask_admin/
contrib
/__init__.py
View file @
2df9b610
File moved
flask_admin/
ext
/fileadmin.py
→
flask_admin/
contrib
/fileadmin.py
View file @
2df9b610
File moved
flask_admin/
ext
/sqlamodel/__init__.py
→
flask_admin/
contrib
/sqlamodel/__init__.py
View file @
2df9b610
File moved
flask_admin/
ext
/sqlamodel/filters.py
→
flask_admin/
contrib
/sqlamodel/filters.py
View file @
2df9b610
File moved
flask_admin/
ext
/sqlamodel/form.py
→
flask_admin/
contrib
/sqlamodel/form.py
View file @
2df9b610
File moved
flask_admin/
ext
/sqlamodel/tools.py
→
flask_admin/
contrib
/sqlamodel/tools.py
View file @
2df9b610
File moved
flask_admin/
ext
/sqlamodel/view.py
→
flask_admin/
contrib
/sqlamodel/view.py
View file @
2df9b610
...
@@ -10,7 +10,7 @@ from flask.ext.babel import gettext
...
@@ -10,7 +10,7 @@ from flask.ext.babel import gettext
from
flask.ext.admin.form
import
BaseForm
from
flask.ext.admin.form
import
BaseForm
from
flask.ext.admin.model
import
BaseModelView
from
flask.ext.admin.model
import
BaseModelView
from
flask.ext.admin.
ext
.sqlamodel
import
form
,
filters
,
tools
from
flask.ext.admin.
contrib
.sqlamodel
import
form
,
filters
,
tools
class
ModelView
(
BaseModelView
):
class
ModelView
(
BaseModelView
):
...
@@ -93,7 +93,7 @@ class ModelView(BaseModelView):
...
@@ -93,7 +93,7 @@ class ModelView(BaseModelView):
"""
"""
Collection of the column filters.
Collection of the column filters.
Can contain either field names or instances of :class:`flask.ext.admin.
ext
.sqlamodel.filters.BaseFilter` classes.
Can contain either field names or instances of :class:`flask.ext.admin.
contrib
.sqlamodel.filters.BaseFilter` classes.
For example::
For example::
...
...
flask_admin/model/filters.py
View file @
2df9b610
...
@@ -119,7 +119,7 @@ def convert(*args):
...
@@ -119,7 +119,7 @@ def convert(*args):
"""
"""
Decorator for field to filter conversion routine.
Decorator for field to filter conversion routine.
See :mod:`flask.ext.admin.
ext
.sqlamodel.filters` for usage example.
See :mod:`flask.ext.admin.
contrib
.sqlamodel.filters` for usage example.
"""
"""
def
_inner
(
func
):
def
_inner
(
func
):
func
.
_converter_for
=
args
func
.
_converter_for
=
args
...
...
flask_admin/tests/test_sqlamodel.py
View file @
2df9b610
...
@@ -6,7 +6,7 @@ from flask.ext import wtf
...
@@ -6,7 +6,7 @@ from flask.ext import wtf
from
flask.ext.sqlalchemy
import
SQLAlchemy
from
flask.ext.sqlalchemy
import
SQLAlchemy
from
flask.ext.admin
import
Admin
from
flask.ext.admin
import
Admin
from
flask.ext.admin.
ext
.sqlamodel
import
ModelView
from
flask.ext.admin.
contrib
.sqlamodel
import
ModelView
class
CustomModelView
(
ModelView
):
class
CustomModelView
(
ModelView
):
...
...
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