Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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 unavailable 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.models.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.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.

Forms:

  • etc.toolbox.set_form_widgets_attrs allows bulk apply HTML attributes to every field widget of a given form.

Template tags:

  • model_field:

    • model_field_verbose_name returns model field verbose name.
    • model_field_help_text returns model field help text.
  • model_meta:

    • model_meta_verbose_name returns model verbose name singular.
    • model_meta_verbose_name_plural returns model verbose name plural.
  • gravatar

    • gravatar_get_url returns Gravatar image URL for a given string or UserModel.
    • gravatar_get_img returns Gravatar image HTML tag for a given string or UserModel.
  • etc_misc

    • site_url does its best to provide you with a site URL whether request object is unavailable or not.
Release History

Release History

This version
History Node

0.10.0

History Node

0.9.2

History Node

0.9.1

History Node

0.9.0

History Node

0.8.0

History Node

0.7.2

History Node

0.7.1

History Node

0.7.0

History Node

0.6.1

History Node

0.6.0

History Node

0.5.0

History Node

0.4.0

History Node

0.3.0

History Node

0.2.0

History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django_etc-0.10.0-py2.py3-none-any.whl (14.0 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Jun 24, 2017
django-etc-0.10.0.tar.gz (18.5 kB) Copy SHA256 Checksum SHA256 Source Jun 24, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting