Automatic model code generator for SQLAlchemy with Flask support
Project description
GitHub page: flask-sqlacodegen
Fork of sqlacodegen by Alex Gronholm. Based off of version 1.1.6.
What’s different:
Support for Flask-SQLAlchemy syntax using --flask option.
Defaults to generating backrefs in relationships. --nobackref still included as option in case backrefs are not wanted.
Naming of backrefs is class name in snake_case (as opposed to CamelCase) and is pluralized if it’s Many-to-One or Many-to-Many using inflect.
Primary joins are explicit.
If column has a server_default set it to FetchValue() instead of trying to determine what that value is. Original code did not set the right server defaults in my setup.
--ignore-cols ignores special columns when generating association tables. Original code requires all columns to be foreign keys in order to generate association table. Example: --ignore-cols id,inserted,updated.
Uses the command flask-sqlacodgen instead of sqlacodegen.
Install
With pip:
pip install flask-sqlacodegen
Without pip:
git clone https://github.com/ksindi/flask-sqlacodegen.git cd flask-sqlacodegen/ python setup.py install
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for flask-sqlacodegen-1.1.6.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | df87f835f20901d5b29db8589439c54bc74f9e0382b86f97b73ac3475ecd2b72 |
|
MD5 | 18e8f41620c43619d4ab802be0d12f73 |
|
BLAKE2b-256 | 6ba2461b00c6efe6e4bedf8dacbba167a259244697b7b279c5d1e5c44cef2237 |
Hashes for flask_sqlacodegen-1.1.6.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c1573d675a6f3ba0337657c09761513cdf9fa290213b5e07b2ff3dcfaa23c7c |
|
MD5 | 10b2474546d3060fde321f2540763f78 |
|
BLAKE2b-256 | 6465e01eb449445c550662c391c8f921dd7990619231f44ebc648897f1883699 |