Skip to main content

FAB Quick Start Utility - build views.py

The fab-quick-start command line utility creates the Flask App Builder views.py file, directly from models.py, for an instant multi-page, multi-table app.

Use this FAB Quick Start Guide to create the app shown below in 10 minutes.

Features

Generated fab pages look as shown below:

  1. Multi-page: apps incude 1 page per table

  2. Multi-table: pages include related_views for each related child table, and join in parent data

  3. Favorite field first: first-displayed field is “name”, or contains “name” (configurable)

  4. Predictive joins: favorite field of each parent is shown (product name - not product id)

  5. Ids last: such boring fields are not shown on lists, and at the end on other pages

https://drive.google.com/uc?export=view&id=1Q3cG-4rQ6Q6RdZppvkrQzCDhDYHnk-F6

Background:

Flask Application Builder (FAB) provides a rapid means for building web pages for database apps, based on Python, Flask and sqlalchemy. Use the Quick Start Guide (link above) to create the application shown above in 10 minutes.

Recall that creating the views.py file can be tedious. This utility generates the views.py file from the models.py file, to save time and reduce learning curve.

Usage:

First, create a fab project (e.g., see the Quick Start Guide).

Then, generate the views.py file like this:

cd <project>  # fab directory containing the config.py file
pip install fab-quick-start
fab-quick-start run

Copy the console output to your views.py file, and run fab / flask app:

export FLASK_APP=app
flask run

Parameters

The simple run command will request 2 parameters, and output to the console. You can specify parameters and output via command line arguments, like this:

fab-quick-start run --favorites="name description" --non_favorites="id" > app/views.py

where:

  • favorites: words() used to find “favorite fields”. Fields named with these words, or containing these words, are placed at the start of lists and show pages. Your values might reflect your language, and your database naming conventions.

  • non_favorites: name(s) used to find fields to be place at the end of list / show pages.

  • the > pipes the output to a file (which is overwritten).

Depends on:

  • Flask-AppBuilder

More information:

The FAB Quick Start github for more information, and explore the code.

Acknowledgements

Many thanks to

  • Daniel Vaz Gaspar, the creator of FAB, for his help and guidance

  • Katrina Huber-Juma, for Python help and final review

  • Tyler Band, for early testing

Change Log

Initial Version

0.9.8 - Fix duplicate view class generation

Metadata

Release files for fab-quick-start 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fab-quick-start 1.0.0
File Size Uploaded Provenance
fab-quick-start-1.0.0.tar.gz 31.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for fab-quick-start 1.0.0
File Interpreter ABI Platform
fab_quick_start-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 74.4 kB

Release files / fab-quick-start-1.0.0.tar.gz

Download URL fab-quick-start-1.0.0.tar.gz
Size 31.1 kB
Tags Source
SHA-256 checksum
How to use checksums
83d78aff47deabf8828809671f48107b1177e7b36bdf3fcbb7787264949aa928
BLAKE2b-256 checksum
How to use checksums
96e050957b3034fd55da388b8e0e46f5f2dd115d2add4e01c46f71a9680e1148
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3

Release files / fab_quick_start-1.0.0-py3-none-any.whl

Download URL fab_quick_start-1.0.0-py3-none-any.whl
Size 43.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6fa1631aef8fb187624e6695e5f37023a6ddcfb5a28f747d4cab267e240eb275
BLAKE2b-256 checksum
How to use checksums
912b00898aa7a19f2969c634f79df4525ef95860bdeed97812f2c2bb4fe5cbda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3

Security for fab-quick-start 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page