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
867779e2
Commit
867779e2
authored
Jan 31, 2013
by
Christopher Toth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor English cleanups across the codebase
parent
de9f1c94
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
actions.py
flask_admin/actions.py
+3
-3
view.py
flask_admin/contrib/mongoengine/view.py
+6
-6
tools.py
flask_admin/tools.py
+3
-3
No files found.
flask_admin/actions.py
View file @
867779e2
...
@@ -29,10 +29,10 @@ class ActionsMixin(object):
...
@@ -29,10 +29,10 @@ class ActionsMixin(object):
Actions mixin.
Actions mixin.
In some cases, you might work with more than one "entity" (model, file, etc) in
In some cases, you might work with more than one "entity" (model, file, etc) in
your admin view and will want to perform actions on
group of entities at once
.
your admin view and will want to perform actions on
a group of entities simultaneously
.
In this case, you can add this functionality by doing this:
In this case, you can add this functionality by doing this:
1. Add mixin to your administrative view class
1. Add
this
mixin to your administrative view class
2. Call `init_actions` in your class constructor
2. Call `init_actions` in your class constructor
3. Expose actions view
3. Expose actions view
4. Import `actions.html` library and add call library macros in your template
4. Import `actions.html` library and add call library macros in your template
...
@@ -76,7 +76,7 @@ class ActionsMixin(object):
...
@@ -76,7 +76,7 @@ class ActionsMixin(object):
def
get_actions_list
(
self
):
def
get_actions_list
(
self
):
"""
"""
Return list and a dictionary of allowed actions.
Return
a
list and a dictionary of allowed actions.
"""
"""
actions
=
[]
actions
=
[]
actions_confirmation
=
{}
actions_confirmation
=
{}
...
...
flask_admin/contrib/mongoengine/view.py
View file @
867779e2
...
@@ -75,7 +75,7 @@ class ModelView(BaseModelView):
...
@@ -75,7 +75,7 @@ class ModelView(BaseModelView):
"""
"""
Field to filter converter.
Field to filter converter.
Override this attribute to use non-default converter.
Override this attribute to use
a
non-default converter.
"""
"""
column_type_formatters
=
DEFAULT_FORMATTERS
column_type_formatters
=
DEFAULT_FORMATTERS
...
@@ -123,7 +123,7 @@ class ModelView(BaseModelView):
...
@@ -123,7 +123,7 @@ class ModelView(BaseModelView):
def
get_pk_value
(
self
,
model
):
def
get_pk_value
(
self
,
model
):
"""
"""
Return primary key value from the model instance
Return
the
primary key value from the model instance
:param model:
:param model:
Model instance
Model instance
...
@@ -154,7 +154,7 @@ class ModelView(BaseModelView):
...
@@ -154,7 +154,7 @@ class ModelView(BaseModelView):
def
scaffold_sortable_columns
(
self
):
def
scaffold_sortable_columns
(
self
):
"""
"""
Return
sortable columns dictionary
(name, field)
Return
a dictionary of sortable columns
(name, field)
"""
"""
columns
=
{}
columns
=
{}
...
@@ -222,7 +222,7 @@ class ModelView(BaseModelView):
...
@@ -222,7 +222,7 @@ class ModelView(BaseModelView):
def
is_valid_filter
(
self
,
filter
):
def
is_valid_filter
(
self
,
filter
):
"""
"""
Validate if
it is
valid MongoEngine filter
Validate if
the provided filter is a
valid MongoEngine filter
:param filter:
:param filter:
Filter object
Filter object
...
@@ -254,7 +254,7 @@ class ModelView(BaseModelView):
...
@@ -254,7 +254,7 @@ class ModelView(BaseModelView):
:param search:
:param search:
Search criteria
Search criteria
:param filters:
:param filters:
List of applied fiters
List of applied fi
l
ters
:param execute:
:param execute:
Run query immediately or not
Run query immediately or not
"""
"""
...
@@ -307,7 +307,7 @@ class ModelView(BaseModelView):
...
@@ -307,7 +307,7 @@ class ModelView(BaseModelView):
def
get_one
(
self
,
id
):
def
get_one
(
self
,
id
):
"""
"""
Return
single model instance by
ID
Return
a single model instance by its
ID
:param id:
:param id:
Model ID
Model ID
...
...
flask_admin/tools.py
View file @
867779e2
...
@@ -30,7 +30,7 @@ def import_attribute(name):
...
@@ -30,7 +30,7 @@ def import_attribute(name):
:param name:
:param name:
String reference.
String reference.
Throw
s ImportError or AttributeError if module or attribute do not exist.
Raise
s ImportError or AttributeError if module or attribute do not exist.
Example::
Example::
...
@@ -80,7 +80,7 @@ def rec_getattr(obj, attr, default=None):
...
@@ -80,7 +80,7 @@ def rec_getattr(obj, attr, default=None):
def
get_dict_attr
(
obj
,
attr
,
default
=
None
):
def
get_dict_attr
(
obj
,
attr
,
default
=
None
):
"""
"""
Get attibute of the object without triggering its __getattr__.
Get att
r
ibute of the object without triggering its __getattr__.
:param obj:
:param obj:
Object
Object
...
@@ -98,7 +98,7 @@ def get_dict_attr(obj, attr, default=None):
...
@@ -98,7 +98,7 @@ def get_dict_attr(obj, attr, default=None):
def
get_property
(
obj
,
name
,
old_name
,
default
=
None
):
def
get_property
(
obj
,
name
,
old_name
,
default
=
None
):
"""
"""
Check if old property name exists and if it
i
s - show warning message
Check if old property name exists and if it
doe
s - show warning message
and return value.
and return value.
Otherwise, return new property value
Otherwise, return new property value
...
...
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