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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 342c878c8170d47920eb8d8e11d8449f009c8a3643f33d56f01d2135207151c9 |
|
MD5 | ddfa82f2f4426beb97458107f5211c8b |
|
BLAKE2b-256 | 0bc3093dea935f9c8d0ec68751894eeda8510d3ea5d5d5a1e80bb8a85a503bbe |
Hashes for flask_sqlacodegen-1.1.6.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4122161791b62caf540d3ae659b4f19fcce6cc95dc5195b3bab3d8f853c31809 |
|
MD5 | 7ef39892ee63db9951046fec431e74ea |
|
BLAKE2b-256 | 3b2ae47611e4fec19e33af5fc90dd57ec2b064056f6c433804742d66e80b2f57 |