Skip to content
Split Django generated models into separated files, with proper names, classes and imports
Python Shell
Branch: master
Clone or download
Latest commit 7263847 Sep 12, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE first commit Sep 10, 2019
README.md Update README.md Sep 10, 2019
models.py add OneToOneField Sep 12, 2019
split_django_models.sh add OneToOneField Sep 12, 2019

README.md

Split Django Models

Split Django generated models into separated files, with proper names, classes and imports.

Usage

Generate your models:

python3 manage.py inspectdb > models.py

Run the script:

./split_django_models.sh models.py

Put them all into a folder so you can enjoy the step bellow:

The script also creates a __init__.py file, so you can import them all at once:

from yourapp.models import *

Done!

Buy me a coffee

Donations

You can’t perform that action at this time.