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
ea3322a0
Commit
ea3322a0
authored
Jun 27, 2013
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inline field list type customizations
parent
1fdfd3f3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
13 deletions
+35
-13
README.rst
README.rst
+2
-2
form.py
flask_admin/contrib/mongoengine/form.py
+1
-0
form.py
flask_admin/contrib/peeweemodel/form.py
+17
-5
form.py
flask_admin/contrib/sqlamodel/form.py
+15
-6
No files found.
README.rst
View file @
ea3322a0
...
...
@@ -11,8 +11,8 @@ Introduction
Flask-Admin is advanced, extensible and simple to use administrative interface building extension for Flask framework.
It comes with batteries included: model scaffolding for `SQLAlchemy <http://www.sqlalchemy.org/>`_,
`MongoEngine <http://mongoengine.org/>`_,
MongoDB
and `Peewee <https://github.com/coleifer/peewee>`_ ORMs, simple
file management interface and a lot of usage
s
amples.
`MongoEngine <http://mongoengine.org/>`_,
`pymongo <http://api.mongodb.org/python/current/>`_
and `Peewee <https://github.com/coleifer/peewee>`_ ORMs, simple
file management interface and a lot of usage
ex
amples.
You're not limited by the default functionality - instead of providing simple scaffolding for the ORM
models, Flask-Admin provides tools that can be used to construct administrative interfaces of any complexity,
...
...
flask_admin/contrib/mongoengine/form.py
View file @
ea3322a0
...
...
@@ -17,6 +17,7 @@ class CustomModelConverter(orm.ModelConverter):
Injects various Flask-Admin widgets and handles lists with
customized InlineFieldList field.
"""
def
__init__
(
self
,
view
):
super
(
CustomModelConverter
,
self
)
.
__init__
()
...
...
flask_admin/contrib/peeweemodel/form.py
View file @
ea3322a0
...
...
@@ -95,6 +95,18 @@ class CustomModelConverter(ModelConverter):
class
InlineModelConverter
(
InlineModelConverterBase
):
"""
Inline model form helper.
"""
inline_field_list_type
=
InlineModelFormList
"""
Used field list type.
If you want to do some custom rendering of inline field lists,
you can create your own wtforms field and use it instead
"""
def
get_info
(
self
,
p
):
info
=
super
(
InlineModelConverter
,
self
)
.
get_info
(
p
)
...
...
@@ -155,7 +167,7 @@ class InlineModelConverter(InlineModelConverterBase):
setattr
(
form_class
,
prop_name
,
InlineModelFormList
(
child_form
,
self
.
inline_field_list_type
(
child_form
,
info
.
model
,
reverse_field
.
name
,
info
,
...
...
flask_admin/contrib/sqlamodel/form.py
View file @
ea3322a0
...
...
@@ -380,6 +380,15 @@ class InlineModelConverter(InlineModelConverterBase):
"""
Inline model form helper.
"""
inline_field_list_type
=
InlineModelFormList
"""
Used field list type.
If you want to do some custom rendering of inline field lists,
you can create your own wtforms field and use it instead
"""
def
__init__
(
self
,
session
,
view
):
super
(
InlineModelConverter
,
self
)
.
__init__
(
view
)
self
.
session
=
session
...
...
@@ -488,7 +497,7 @@ class InlineModelConverter(InlineModelConverterBase):
# Contribute field
setattr
(
form_class
,
forward_prop
.
key
,
InlineModelFormList
(
child_form
,
self
.
inline_field_list_type
(
child_form
,
self
.
session
,
info
.
model
,
reverse_prop
.
key
,
...
...
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