Commit 1827b349 authored by Petrus J.v.Rensburg's avatar Petrus J.v.Rensburg

Update 'sqla' example to use Bootstrap 3.

parent 1f43bc89
...@@ -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))
......
...@@ -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))
......
{% 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 %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment