Login

Snippets by djm

Snippet List

Accordion changelist admin

This is adapted from [rodnsi's version](http://djangosnippets.org/snippets/1818/) to work with Django 1.2 (as django.contrib.admin came with jQuery built in as of 1.2).

  • filter
  • hide
  • collapse
  • changelist
  • list_filter
  • accordion
  • collapsible
Read More
Author: djm
  • 2
  • 3

Filter; Capitalise Sentences (capsentence)

Given a string, it first lowercases it, then uppercases the first letter of each sentence. Helpful when dealing with awfully formatted entirely UPPERCASE XML product data feeds.

  • capitalize
  • capitalise
  • sentence
  • sentences
  • capitalises
  • capitalizes
  • prettifies
  • sentance
Read More
Author: djm
  • 1
  • 0

CountryField (UN Country List, 3 Char Codes)

**Adapted from** [CountryField](http://www.djangosnippets.org/snippets/494/) - **Initial thanks to marinho** Uses the UN country list listed in the source - this provides the 3 character ISO country code. Ordered by display value and not country code. Just place anywhere you like and import CountryField to use. `country = CountryField(verbose_name="Country", help_text="The registrant's country of residence.")`

  • forms
  • form
  • field
  • list
  • country
  • countries
  • custom
  • custom-field
  • countryfield
  • countrys
Read More
Author: djm
  • 1
  • 1

djm has posted 3 snippets.