Login

Tag "modelfield"

Snippet List

models ColorField with clean minimal widget

A simple model ColorField that allows picking from a predefined list (currently picked up from settings.py The widget displays as a row of coloured SPAN's with the hex code inside. Simply click to choose a color. (requires jQuery in the page assigned to it's normal $ shortcut. Easy to change this is you don't use jQuery in this way)

  • models
  • admin
  • jquery
  • widget
  • custom-field
  • modelfield
Read More

ISBN model field: displays 10- and 13-digit variants and external links

Requires [PyISBN](http://pypi.python.org/pypi/pyisbn/0.5.2). Use like so: class Book(models.Model): title = models.TextField() isbn = ISBNField() ... the link in the widget can be changed to amazon, borders, you name it. If the DB version is a 13-digit ISBN, the display box contains the 10-digit, labeled; and vice-versa.

  • django
  • model
  • python
  • widget
  • modelfield
  • isbn
  • books
Read More

4 snippets posted so far.