HTML Hex Color Field
A custom form field than validates html hex color fields
- fields
- forms
- color
- hex
A custom form field than validates html hex color fields
A CharField (Model) that checks that the value is a valid HTML color code (Hex triplet) like #FFEE00.
Usage: (if you save it as pigmentation.py as I did) {% load pigmentation %} {% autoescape off %} {{ somevariable|pygmentize }} {% endautoescape %} There already a few of this code around, but this one is pretty clean, and includes css. It also works in both the development server and Dreamhost (python2.4 in my django config) without any unicode problems.