Skip to content

Commit

Permalink
docs update for altering the default index template
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgaspar committed Sep 17, 2015
1 parent f8d3ac6 commit e0dd2c5
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Lots of `examples <https://github.com/dpgaspar/Flask-AppBuilder/tree/master/exam
Package Version
---------------

*New 1.4.5*.
*New 1.4.6*.

If you're already using F.A.B.
read carefully the `migration <http://flask-appbuilder.readthedocs.org/en/latest/versionmigration.html>`_ procedures.
Expand Down
Binary file modified docs/_build/doctrees/customizing.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/versions.doctree
Binary file not shown.
11 changes: 10 additions & 1 deletion docs/_build/html/_sources/customizing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,22 @@ So that we can use Babel to translate our index text

2 - Define an IndexView

Define a special and simple view inherit from IndexView::
Define a special and simple view inherit from IndexView, don't define this view on views.py, put it on a separate file like index.py::

from flask.ext.appbuilder import IndexView


class MyIndexView(IndexView):
index_template = 'index.html'

3 - Tell F.A.B to use your index view, when initializing AppBuilder::


from app.index import MyIndexView

app = Flask(__name__)
app.config.from_object('config')
db = SQLA(app)
appbuilder = AppBuilder(app, db.session, indexview=MyIndexView)


Expand Down
2 changes: 2 additions & 0 deletions docs/_build/html/_sources/versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Improvements and Bug fixes on 1.4.6
- Fix, #219 Making the inline crud stateless, CompatCRUDMixin.
- Fix, #216 English issues found during translation.
- New, config key, FILE_ALLOWED_EXTENSIONS, issue #221.
- New, #217, Polish translations.
- Fix, flask-login version pin on 0.2.11.

Improvements and Bug fixes on 1.4.5
-----------------------------------
Expand Down
14 changes: 11 additions & 3 deletions docs/_build/html/customizing.html
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,21 @@ <h2>Changing the index<a class="headerlink" href="#changing-the-index" title="Pe
</div>
<p>So that we can use Babel to translate our index text</p>
<p>2 - Define an IndexView</p>
<p>Define a special and simple view inherit from IndexView:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">MyIndexView</span><span class="p">(</span><span class="n">IndexView</span><span class="p">):</span>
<p>Define a special and simple view inherit from IndexView, don&#8217;t define this view on views.py, put it on a separate file like index.py:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">flask.ext.appbuilder</span> <span class="kn">import</span> <span class="n">IndexView</span>


<span class="k">class</span> <span class="nc">MyIndexView</span><span class="p">(</span><span class="n">IndexView</span><span class="p">):</span>
<span class="n">index_template</span> <span class="o">=</span> <span class="s">&#39;index.html&#39;</span>
</pre></div>
</div>
<p>3 - Tell F.A.B to use your index view, when initializing AppBuilder:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">appbuilder</span> <span class="o">=</span> <span class="n">AppBuilder</span><span class="p">(</span><span class="n">app</span><span class="p">,</span> <span class="n">db</span><span class="o">.</span><span class="n">session</span><span class="p">,</span> <span class="n">indexview</span><span class="o">=</span><span class="n">MyIndexView</span><span class="p">)</span>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">app.index</span> <span class="kn">import</span> <span class="n">MyIndexView</span>

<span class="n">app</span> <span class="o">=</span> <span class="n">Flask</span><span class="p">(</span><span class="n">__name__</span><span class="p">)</span>
<span class="n">app</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">from_object</span><span class="p">(</span><span class="s">&#39;config&#39;</span><span class="p">)</span>
<span class="n">db</span> <span class="o">=</span> <span class="n">SQLA</span><span class="p">(</span><span class="n">app</span><span class="p">)</span>
<span class="n">appbuilder</span> <span class="o">=</span> <span class="n">AppBuilder</span><span class="p">(</span><span class="n">app</span><span class="p">,</span> <span class="n">db</span><span class="o">.</span><span class="n">session</span><span class="p">,</span> <span class="n">indexview</span><span class="o">=</span><span class="n">MyIndexView</span><span class="p">)</span>
</pre></div>
</div>
<p>Of course you can use a more complex index view, you can use any kind of view (BaseView childs), you can even
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/searchindex.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/_build/html/versions.html
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ <h2>Improvements and Bug fixes on 1.4.6<a class="headerlink" href="#improvements
<li>Fix, #219 Making the inline crud stateless, CompatCRUDMixin.</li>
<li>Fix, #216 English issues found during translation.</li>
<li>New, config key, FILE_ALLOWED_EXTENSIONS, issue #221.</li>
<li>New, #217, Polish translations.</li>
<li>Fix, flask-login version pin on 0.2.11.</li>
</ul>
</div>
<div class="section" id="improvements-and-bug-fixes-on-1-4-5">
Expand Down
11 changes: 10 additions & 1 deletion docs/customizing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,22 @@ So that we can use Babel to translate our index text

2 - Define an IndexView

Define a special and simple view inherit from IndexView::
Define a special and simple view inherit from IndexView, don't define this view on views.py, put it on a separate file like index.py::

from flask.ext.appbuilder import IndexView


class MyIndexView(IndexView):
index_template = 'index.html'

3 - Tell F.A.B to use your index view, when initializing AppBuilder::


from app.index import MyIndexView

app = Flask(__name__)
app.config.from_object('config')
db = SQLA(app)
appbuilder = AppBuilder(app, db.session, indexview=MyIndexView)


Expand Down
2 changes: 2 additions & 0 deletions docs/versions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Improvements and Bug fixes on 1.4.6
- Fix, #219 Making the inline crud stateless, CompatCRUDMixin.
- Fix, #216 English issues found during translation.
- New, config key, FILE_ALLOWED_EXTENSIONS, issue #221.
- New, #217, Polish translations.
- Fix, flask-login version pin on 0.2.11.

Improvements and Bug fixes on 1.4.5
-----------------------------------
Expand Down

0 comments on commit e0dd2c5

Please sign in to comment.