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
1827b349
Commit
1827b349
authored
Jun 14, 2015
by
Petrus J.v.Rensburg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 'sqla' example to use Bootstrap 3.
parent
1f43bc89
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
16 deletions
+18
-16
app.py
examples/sqla/app.py
+1
-1
app2.py
examples/sqla/app2.py
+1
-1
index.html
examples/sqla/templates/admin/index.html
+16
-14
No files found.
examples/sqla/app.py
View file @
1827b349
...
@@ -144,7 +144,7 @@ class TreeView(sqla.ModelView):
...
@@ -144,7 +144,7 @@ class TreeView(sqla.ModelView):
# Create admin
# Create admin
admin
=
admin
.
Admin
(
app
,
name
=
'Example: SQLAlchemy'
)
admin
=
admin
.
Admin
(
app
,
name
=
'Example: SQLAlchemy'
,
template_mode
=
'bootstrap3'
)
# Add views
# Add views
admin
.
add_view
(
UserAdmin
(
User
,
db
.
session
))
admin
.
add_view
(
UserAdmin
(
User
,
db
.
session
))
...
...
examples/sqla/app2.py
View file @
1827b349
...
@@ -50,7 +50,7 @@ class TyreAdmin(sqla.ModelView):
...
@@ -50,7 +50,7 @@ class TyreAdmin(sqla.ModelView):
form_columns
=
[
'car'
,
'tyre_id'
,
'desc'
]
form_columns
=
[
'car'
,
'tyre_id'
,
'desc'
]
# Create admin
# Create admin
admin
=
admin
.
Admin
(
app
,
name
=
'Example: SQLAlchemy2'
)
admin
=
admin
.
Admin
(
app
,
name
=
'Example: SQLAlchemy2'
,
template_mode
=
'bootstrap3'
)
admin
.
add_view
(
CarAdmin
(
Car
,
db
.
session
))
admin
.
add_view
(
CarAdmin
(
Car
,
db
.
session
))
admin
.
add_view
(
TyreAdmin
(
Tyre
,
db
.
session
))
admin
.
add_view
(
TyreAdmin
(
Tyre
,
db
.
session
))
...
...
examples/sqla/templates/admin/index.html
View file @
1827b349
{% extends 'admin/master.html' %}
{% extends 'admin/master.html' %}
{% block body %}
{% block body %}
{{ super() }}
{{ super() }}
<div
class=
"row"
>
<div
class=
"container"
>
<div
class=
"span10 offset1"
>
<div
class=
"row"
>
<h1>
Flask-Admin example
</h1>
<div
class=
"col-sm-10 col-sm-offset-1"
>
<p
class=
"lead"
>
<h1>
Flask-Admin example
</h1>
Basic SQLAlchemy model views.
<p
class=
"lead"
>
</p>
Basic SQLAlchemy model views.
<p>
</p>
This example shows how to add basic CRUD-views for your SQLAlchemy models.
<p>
</p>
This example shows how to add basic CRUD-views for your SQLAlchemy models.
<p>
</p>
The views are generated automatically, but it is perfectly possible to customize them to suit your needs.
<p>
</p>
The views are generated automatically, but it is perfectly possible to customize them to suit your needs.
<a
class=
"btn btn-primary"
href=
"/"
><i
class=
"icon-arrow-left icon-white"
></i>
Back
</a>
</p>
</div>
<a
class=
"btn btn-primary"
href=
"/"
><i
class=
"glyphicon glyphicon-chevron-left"
></i>
Back
</a>
</div>
</div>
</div>
</div>
{% endblock body %}
{% endblock body %}
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