A package to create boring stuff of django rest framework
Project description
django-easy-drf
A package that makes for you the repetitive work of creating Serializers, ViewSets and urls for django rest framework.
Installation
On a virtualenv run:
pip install django-easy-drf
Usage
On the same virtualenv, you will have easy-drf command available, so run:
easy-drf
This command will create serializers.py, views.py and urls.py files on the same directory, with all the classes created.
Note: requires that a file called models.py exists on the current directory.
Forcing creation
If you want to avoid command prompt, you can force it:
easy-drf --force
or less verbose:
easy-drf -f
Creating only one file
Sometimes you don't need all files (views, serializers and urls) so you can specify which ones should be created. Options are:
- 's' for serializers.py
- 'v' for views.py
- 'u' for urls.py
For example, this command will create serializers.py and views.py
easy-drf --files s v
If you don't specify --files argument, all files will be created.
Getting help
For help, type:
easy-drf --help
or less verbose:
easy-drf -h
This command will list the available cli options.
Future developments
- Warn users about files override.
- Allow users to force script without prompt.
- Allow users to create just one specific file.
- Allow users to create just one model.
- Allow users to specify different models file.
- Allow users to specify different results file names.
Contributing
If you have an idea or an implementation, let me know by submitting an issue or a PR.
Project details
Release history Release notifications | RSS feed
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 django_easy_drf-0.0.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f1b48b46fc383bdd8d6df6635e9e35628238288d25e411ab285b12260d48413 |
|
MD5 | 50532caf1a1d60c83b0bc443b8806c31 |
|
BLAKE2b-256 | 2712a31bbba392b7324ea0dbc329bb1d99bcd6cc03407c8c7bff9ff6f0cab82a |