Skip to content

Commit

Permalink
docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgaspar committed Oct 12, 2014
1 parent 99b051b commit cf1a986
Show file tree
Hide file tree
Showing 36 changed files with 439 additions and 72 deletions.
Binary file modified docs/_build/doctrees/actions.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/api.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/config.doctree
Binary file not shown.
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/generic_datasource.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/installation.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/intro.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/quickhowto.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/versions.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/views.doctree
Binary file not shown.
41 changes: 36 additions & 5 deletions docs/_build/html/_sources/actions.txt
Expand Up @@ -4,7 +4,11 @@ Actions
Define your view
----------------

You can setup your actions for records on the show page. Just use the @action decorator on your own functions
You can setup your actions on records on the show or list views.
This is a powerful feature, you can easily add custom functionality to your db records,
like mass delete, sending emails with record information, special mass update etc.

Just use the @action decorator on your own functions. Here's an example

::

Expand All @@ -14,13 +18,40 @@ You can setup your actions for records on the show page. Just use the @action de
datamodel = SQLAModel(Group)
related_views = [ContactModelView]

@action("myaction","Do something on this record","","fa-rocket")
@action("myaction","Do something on this record","Do you really want to?","fa-rocket")
def myaction(self, item):
"""
do something with the item record
"""
return redirect(url_for('.'))
return redirect(self.get_redirect())

This will create the necessary permissions for the item, so that you can include them or remove them from a particular role.
This will create the necessary permissions for the item,
so that you can include or remove them from a particular role.

You can easily implement a massive delete option on list's. Just add the following code
to your view. This example will tell F.A.B. to implement the action just for list views and not
show the option on the show view. You can do this by disabling the *single* or *multiple*
parameters on the **@action** decorator.

::

@action("muldelete", "Delete", "Delete all Really?", "fa-rocket", single=False)
def muldelete(self, items):
self.datamodel.delete_all(items)
self.update_redirect()
return redirect(self.get_redirect())


F.A.B will call your function with a list of record items if called from a list view.
Or a single item if called from a show view. By default an action will be implemented on
list views and show views so your method's should be prepared to handle a list of records or
a single record::

It will render a button for each action you define on the show page of *ModelView*
@action("muldelete", "Delete", "Delete all Really?", "fa-rocket")
def muldelete(self, items):
if isinstance(items, list):
self.datamodel.delete_all(items)
self.update_redirect()
else:
self.datamodel.delete(items)
return redirect(self.get_redirect())
2 changes: 1 addition & 1 deletion docs/_build/html/_sources/config.txt
Expand Up @@ -4,7 +4,7 @@ Base Configuration
Configuration keys
------------------

Use config.py to configure the following parameters. By default it will use SQLLITE DB, and bootstrap 3.0.0 base theme:
Use config.py to configure the following parameters. By default it will use SQLLITE DB, and bootstrap 3.1.1 base theme:

+-----------------------------------+--------------------------------------------+-----------+
| Key | Description | Mandatory |
Expand Down
10 changes: 7 additions & 3 deletions docs/_build/html/_sources/customizing.txt
Expand Up @@ -66,7 +66,8 @@ Define a special and simple view inherit from IndexView::
Changing the Footer
-------------------

The default footer can be easily changed by your own. You must develop your template, to override the existing one.
The default footer can be easily changed by your own. You must develop your template,
to override the existing one.

Develop your jinja2 template and place it on the following relative path to override the F.A.B footer.

Expand Down Expand Up @@ -114,9 +115,12 @@ Category icon and label can be setup only for the first time. Internally F.A.B.
Changing Widgets and Templates
------------------------------

F.A.B. has a collection of widgets to change your views presentation, you can create your own and override, or (even better) create them and contribute to the project on git.
F.A.B. has a collection of widgets to change your views presentation,
you can create your own and override,
or (even better) create them and contribute to the project on git.

All views have templates that will display widgets in a certain layout. For example you can display a record related lists on tab (default) or on the same page.
All views have templates that will display widgets in a certain layout.
For example you can display a record related lists on tab (default) or on the same page.

::

Expand Down
6 changes: 3 additions & 3 deletions docs/_build/html/_sources/generic_datasource.txt
Expand Up @@ -2,14 +2,14 @@ Generic Data Sources
====================

This feature is still beta, but you can already use it, it allows you to use alternative/generic datasources.
With it you can use python libraries, systems commands or whatever with the framework has if they were
With it you can use python libraries, systems commands or whatever with the framework as if they were
SQLAlchemy models.

PS Command example
------------------

Already on the framework, and intended to be an example is a data source that holds the output from
the linux 'ps -ef' command, and shows it has if it were an SQLA model.
Already on the framework, and intended to be an example, is a data source that holds the output from
the linux 'ps -ef' command, and shows it as if it were a SQLA model.

Your own generic data source must subclass from **GenericSession** and implement at least the **all** method

Expand Down
18 changes: 16 additions & 2 deletions docs/_build/html/_sources/installation.txt
Expand Up @@ -7,8 +7,7 @@ so that you can immediately have a running application (without any models yet)

Checkout installation video on `YouTube <http://youtu.be/ZrqFDroqqWE>`_

.. note::
Remember the initial user is **'admin'** password **'general'**.
.. note:: Remember the initial user is **'admin'** password **'general'**.

Using pip
---------
Expand Down Expand Up @@ -121,3 +120,18 @@ or::

pip install PIL


Python 2 and 3 Compatibility
----------------------------

The framework itself is compatible and has been tested for Python 2.6, 2.7 and 3.3.
But there is still one problem in Python 3.3, the framework internationalization feature
uses the excellent package Babel, but i've found an incompatibility on it for python 3.3.
While this problem is not solved there is a limitation for Py3.3 on F.A.B. you can't use
Babel's features, so on config you must only setup english::

BABEL_DEFAULT_LOCALE = 'en'
BABEL_DEFAULT_FOLDER = 'translations'
LANGUAGES = {
'en':{'flag':'gb','name':'English'}
}
7 changes: 4 additions & 3 deletions docs/_build/html/_sources/intro.txt
Expand Up @@ -5,9 +5,9 @@ The main goal for this project is to provide a simple development framework
that handles the main problems any web application or site encounters.
It will help you adhere to the DRY (Don't repat yourself) principle.

Keeping on mind that it must be possible to develop directly on Flask/Jinja2 for custom pages or flows,
that painlessly integrate the framework.
But the framework it self should go further then an admin scaffolding package.
Keep in mind that it must be possible to develop directly on Flask/Jinja2 for custom pages or flows,
that painlessly integrate with the framework.
But the framework itself should go further than an admin scaffolding package.
It should have builtin presentation alternatives, and behaviour.
Should be highly configurable, and should have extra goodies.

Expand Down Expand Up @@ -36,6 +36,7 @@ Includes:
- Views and Widgets
- Automatic menu generation.
- Automatic CRUD generation.
- Multiple actions on db records.
- Big variety of filters for your lists.
- Various view widgets: lists, master-detail, list of thumbnails etc
- Select2, Datepicker, DateTimePicker
Expand Down
31 changes: 28 additions & 3 deletions docs/_build/html/_sources/quickhowto.txt
Expand Up @@ -170,10 +170,35 @@ Register everything, to present the models and create the menu. Issue **create_a
Take a look at the :doc:`api` for add_view method.

.. note::
The icons for the menu on this examples are from font-awesome, Checkout fontAwesome `Icons <http://fontawesome.io/icons/>`_ names. Font-Awesome is already included and you can use any icon you like on menus and actions
The icons for the menu on this examples are from font-awesome,
Checkout fontAwesome `Icons <http://fontawesome.io/icons/>`_ names.
Font-Awesome is already included and you can use any icon you like on menus and actions

With this very few lines of code (and could be fewer), you now have a web application with detailed security for each CRUD primitives and Menu options, authentication, and form field validation. Yet you can extensively change many details, add your own triggers before or after CRUD primitives, develop your own web views and integrate them.

With this very few lines of code (and could be fewer), you now have a web application
with detailed security for each CRUD primitives and Menu options, authentication,
and form field validation. Yet you can extensively change many details,
add your own triggers before or after CRUD primitives, develop your own web views and integrate them.

Exposed methods and JSON
------------------------

Your **ModelView** classes expose the following methods has flask endpoints

- list
- show
- add
- edit
- delete
- download
- action
- json

This exposes a REST API, note the *json* method, it will return query results just like the *list*
method, try it, you can use it on your own template implementations, it will return a JSON object
with the columns to list, to order, the label's for the columns (already translated), the full
query count, and of course the query results, it supports pagination also.

*json* method uses the *list* method security name 'can_list'.

You can find this example at: https://github.com/dpgaspar/Flask-AppBuilder/tree/master/examples/quickhowto

Expand Down
46 changes: 40 additions & 6 deletions docs/_build/html/_sources/versions.txt
@@ -1,19 +1,53 @@
Versions
========

Improvements and Bug fixes on 1.0.0
-----------------------------------

- New, dynamic package version from python file version.py.
- New, extra_args property, for injecting extra arguments to templates.
- Fix, Removed footer with link "Powered by F.A.B.".
- Fix, Added translation for "Access is denied". ES,GE,RU,ZH
- New, Yes and no questions with bootstrap modal.
- Fix, Added multiple actions support on other list widgets.
- Fix, missing translations for "User info" and "Audit info".

Improvements and Bug fixes on 0.10.7
------------------------------------

- Fix, actions break on MasterDetail or related views.

Improvements and Bug fixes on 0.10.6
------------------------------------

- New, Support for multiple actions.

Improvements and Bug fixes on 0.10.5
------------------------------------

- Fix, Russian translations from pull request #39

Improvements and Bug fixes on 0.10.4
------------------------------------

- Fix, merge problem. issue #38

Improvements and Bug fixes on 0.10.3
------------------------------------

- Fix, inserted script in init.html moved to ab.js on static/js.
- Fix, performance improvement on edit, only one form initialization.
- New, New back mechanism, with 5 history records. issue #35.
- New, json endpoint for model querys, with same parameters has list endpoint.
- New, support for boolean columns search, filter with FilterEqual or FilterNotEqual.

Improvements and Bug fixes on 0.10.2
------------------------------------

- Fix, get order columns was including relations.
- New, possibility to include primary key and foreign key on forms and views.
- Fix, python 3 errors on GenericModels, metaclass compatibility.

TODO:
- Fix, translation for sec decorator "Access is denied bla bla"
- Fix, Removal of permission works well but generates error on last iteration.
- Doc, Application factory method
- Doc, Python 2 and 3 support.

Improvements and Bug fixes on 0.10.1
------------------------------------

Expand Down
11 changes: 10 additions & 1 deletion docs/_build/html/_sources/views.txt
Expand Up @@ -143,6 +143,7 @@ inside it create a file name 'method3.html'
# do something with param1
# and render template with param
param1 = 'Goodbye %s' % (param1)
self.update_redirect()
return render_template('method3.html',
param1 = param1,
appbuilder=self.appbuilder)
Expand All @@ -153,7 +154,15 @@ inside it create a file name 'method3.html'

Has you can see you just have to extend "appbuilder/base.html" on your template and then override *block content*.
You have many other *blocks* to override extending css includes, javascript, headers, tails etc...
Next use **Flask** **render_template** to render you new template
Next use **Flask** **render_template** to render your new template.

.. note::

Update redirect, on version 0.10.3, the redirect algorithm was reviewed, and uses session cookies to keep
5 records of navigation history, these are very usefull to redirect back, keeping url arguments, and
improving UI experience. You must call *self.update_redirect()* to insert the current url into the
navigation history. Sometimes you may want to skip the update, for example on form validation errors, so that
the *back* operation won't send you to the same form, prior to the validation error.


SimpleFormView
Expand Down

0 comments on commit cf1a986

Please sign in to comment.