https://github.com/victorqribeiro/splitdjangomodels
Split Django generated models into separated files, with proper names, classes and imports
https://github.com/victorqribeiro/splitdjangomodels
bash django models script split
Last synced: about 1 year ago
JSON representation
Split Django generated models into separated files, with proper names, classes and imports
- Host: GitHub
- URL: https://github.com/victorqribeiro/splitdjangomodels
- Owner: victorqribeiro
- License: mit
- Created: 2019-09-10T22:24:24.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-12T22:34:47.000Z (almost 7 years ago)
- Last Synced: 2025-03-30T23:11:27.514Z (about 1 year ago)
- Topics: bash, django, models, script, split
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Split Django Models
Split Django generated models into separated files, with proper names, classes and imports.
## Usage
Generate your models:
```bash
python3 manage.py inspectdb > models.py
```
Run the script:
```bash
./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:
```python
from yourapp.models import *
```
Done!
## Buy me a coffee
[](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=victorqribeiro%40gmail%2ecom&lc=BR&item_name=Victor%20Ribeiro&item_number=donation¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted)