Tiny stuff for Django that won't fit into separate apps.
Project description
https://github.com/idlesign/django-etc
Description
Tiny stuff for Django that won’t fit into separate apps.
Utils
etc.toolbox.get_site_url does its best to provide you with a site URL whether request object is available or not.
etc.toolbox.import_app_module imports and returns a module from a specific app by its name.
etc.toolbox.import_project_modules imports modules from registered apps using given module name and returns them as a list.
Models
etc.toolbox.InheritedModel allows to override fields attributes in inherited models.
etc.toolbox.get_model_class_from_string allows getting model class from its string representation.
etc.toolbox.get_model_class_from_settings allows getting model class from its string representation in settings module.
etc.toolbox.ChoicesEnumMixin helps to define choices for models using Enum from Python 3.
etc.toolbox.choices_list helps to define choices for models, that could be addressed later as dictionaries.
etc.toolbox.get_choices returns model field choices from a given choices list.
Admin
etc.admin.CustomModelPage allows easy construction of custom admin pages processing user input.
Forms
etc.toolbox.set_form_widgets_attrs allows bulk apply HTML attributes to every field widget of a given form.
Documentation
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_etc-1.3.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c58f9a85872cbd88d6d98a6bf2cc4aba5eb739eccaaacc27d049435ff5378e4e |
|
MD5 | e4b80f352b5091289163a0747cd0dc7f |
|
BLAKE2b-256 | 0d8ee345a6147fc667ed91ae89e100664e8713c3ff5e43a4555fd236df754e45 |