Skip to main content

The Django Common (djcommon) project is a set of project independent reusable features easy to use while developing with the Django Framework - https://www.djangoproject.com/.

Features

Currently, the following features have been gathered and are working in Django 1.3+

models
  • TimeStampedModel (adds date_created and date_modified)

fields
  • MultiSelectField (for selecting multiple choices=)

views
  • server_error (500 error handler with RequestContext)

admin
  • EnhancedModelAdmin (keeping filter states after edits)

  • EnhancedInline (implements VerboseManyToManyRawIdWidget on m2m fields when name in raw_id_fields)

middleware
  • SSLMiddleware

  • RestrictedAccessMiddleware

  • StripWhitespaceMiddleware

helpers
  • get_setting (shortcut for getattr(settings, ‘SITE_ID’))

  • uniqify_list

  • contains

auth
  • EmailBackend (authenticate user by email address or username)

forms
  • EnhancedForm

  • EnhancedModelForm (combined_fields)

widgets
  • DiggPaginatorWidget

  • admin.VerboseManyToManyRawIdWidget

template
  • get_available_templates

  • get_template_choices

  • CachedNode

  • ContextUpdatingNode

  • CachedContextUpdatingNode

templatetags
  • common
    • filters: cleartags, cut, replace, nowhitespace, cleanwhitespace, startswith, endswith

  • development
    • filters: attributes, attributes_formatted, getattribute

templates
  • forms/as_div.html

email
  • send_email_with_template (including an handy directory structure for templates)

pdf
  • content_to_pdf

  • content_to_response

  • render_to_pdf

xml
  • fast_iter

TODO

admin
  • EnhancedInline with Nested inline function

If you have ideas for other features please let me know.

Installation

  1. pip install djcommon

  2. Add djcommon to your INSTALLED_APPS if you want to use templates and templatetags

TODOs and BUGS

See: http://github.com/baskoopmans/djcommon/issues

Release files for djcommon 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for djcommon 1.1.1
File Size Uploaded
djcommon-1.1.1.zip 48.5 kB Details

Release files / djcommon-1.1.1.zip

Download URL djcommon-1.1.1.zip
Size 48.5 kB
Tags Source
SHA-256 checksum
How to use checksums
276c8869e3574587b8f5c3119866102e32edffae835228dbd46df0eb93e5d978
BLAKE2b-256 checksum
How to use checksums
97e8aff7389daf3fc6f535fe82abd4ffacbc8d4b23a6468a1a3029ab5d8c946d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.1.1 This release

1 release file

1.1.0

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.3.4

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page