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
2e86d615
Commit
2e86d615
authored
Oct 05, 2012
by
Priit Laes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve docs on how to use custom InlineFormAdmin for inline_models
parent
825e097a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
view.py
flask_admin/contrib/peeweemodel/view.py
+7
-7
view.py
flask_admin/contrib/sqlamodel/view.py
+5
-5
No files found.
flask_admin/contrib/peeweemodel/view.py
View file @
2e86d615
...
...
@@ -70,23 +70,23 @@ class ModelView(BaseModelView):
Accept enumerable with one of the values:
1. Child model class
1. Child model class
::
class MyModelView(ModelView):
inline_models = (Post,)
2. Child model class and additional options
2. Child model class and additional options
::
class MyModelView(ModelView):
inline_models = [(Post, dict(form_columns=['title']))]
3. Django-like ``InlineFormAdmin`` class instance
3. Django-like ``InlineFormAdmin`` class instance
::
class MyInlineForm(InlineFormAdmin):
for
u
m_columns = ('title', 'date')
class MyInline
Model
Form(InlineFormAdmin):
form_columns = ('title', 'date')
class MyModelView(ModelView):
inline_models = (MyInline
Form
,)
inline_models = (MyInline
ModelForm(MyInlineModel)
,)
"""
def
__init__
(
self
,
model
,
name
=
None
,
...
...
@@ -340,7 +340,7 @@ class ModelView(BaseModelView):
count
+=
1
flash
(
ngettext
(
'Model was successfully deleted.'
,
'
%(count)
s models were sucessfully deleted.'
,
'
%(count)
s models were suc
c
essfully deleted.'
,
count
,
count
=
count
))
except
Exception
,
ex
:
...
...
flask_admin/contrib/sqlamodel/view.py
View file @
2e86d615
...
...
@@ -145,7 +145,7 @@ class ModelView(BaseModelView):
inline_models
=
None
"""
Inline related-model editing for models with parent
to child relation
.
Inline related-model editing for models with parent
-child relations
.
Accepts enumerable with one of the following possible values:
...
...
@@ -161,11 +161,11 @@ class ModelView(BaseModelView):
3. Django-like ``InlineFormAdmin`` class instance::
class MyInlineForm(InlineFormAdmin):
for
u
m_columns = ('title', 'date')
class MyInline
Model
Form(InlineFormAdmin):
form_columns = ('title', 'date')
class MyModelView(ModelView):
inline_models = (MyInline
Form
,)
inline_models = (MyInline
ModelForm(MyInlineModel)
,)
"""
def
__init__
(
self
,
model
,
session
,
...
...
@@ -657,7 +657,7 @@ class ModelView(BaseModelView):
self
.
session
.
commit
()
flash
(
ngettext
(
'Model was successfully deleted.'
,
'
%(count)
s models were sucessfully deleted.'
,
'
%(count)
s models were suc
c
essfully deleted.'
,
count
,
count
=
count
))
except
Exception
,
ex
:
...
...
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