A collection of handy utilities to support django operations
Project description
django-handy-helpers
Author | David Slusser | |
Description | A collection of handy utilities to support django projects | |
Requirements | Python 3.x Django 2.2.x |
Documentation
Full documentation can be found on http://django-handyhelpers.readthedocs.org. Documentation source files are available in the docs folder.
How to Install
The django-userextensions package is available on Python Package Index (PyPI) and can be installed via pip:
pip install django-handyhelpers
add 'handyhelpers' to your INSTALLED_APPS (for management commands and templates)
INSTALLED_APPS = [
...
'handyhelpers',
]
Management Commands
DRF Generator
Django-handyhelpers includes manage.py commands to generate DRF files (api views, serializers, urls) for a given app in your project. This is done using jinja templates that define the structure of each file. Default templates are provided, and custom templates can be provided in the command. By default, all models and models fields are included.
Example command:
manage.py generate_drf <my_app> --serializer
manage.py generate_drf <my_app> --serializer --serializer_template <my_custom_template>
** use the --help parameter for a full list of options
manage.py generate_drf --help
Admin Generator
Included with django-handyhelpers are manage.py commands to auto-generate an admin.py file for a given application in your project. This is done using a jinja template that defines the structure of the admin.py file. A default template is provided.
Example command:
manage.py generate_admin <my_app>
manage.py generate_admin <my_app> --template <my_custom_template>
** use the --help parameter for a full list of options
manage.py generate-admin --help
Mixins
FilterByQueryParamsMixin
Allows your list views to be filtered by query parameters.
InvalidLookupMixin
Returns an applicable error, instead of results based on an unfiltered queryset, if a provided lookup expression, filter, or model field is invalid.
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-handyhelpers-0.3.22.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20adc6302406e21c1dde583301ec3a18b3e5cd51c280e10830da10214e8042c5 |
|
MD5 | b760d60c6764abaadad8f5a23ece15d2 |
|
BLAKE2b-256 | d9efc5af4905c68a41ad9a2cc283f04a0d4e76fe0679bff5316d87af113ae79d |
Hashes for django_handyhelpers-0.3.22-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f958053fd6dabd83693ae4937bc21c4d4af654bf5182ccd40bd125b8e2534713 |
|
MD5 | b5883322c965d9cf2a63a47ef45d59b7 |
|
BLAKE2b-256 | 7f617bdea0288a9a5290e6dc4874a545563b603e89e11e3bad11fc25d8b62086 |