Archive for the ‘model’ Tag
HTML color code field
I needed a field that checks that the value is a valid HTML color code (Hex triplet) like #FFEE00. I started searching, but only found requests for such a field, but no working solution. So it was time to write my first custom DB-model-field. I found this very nice Paper http://toys.jacobian.org/presentations/2007/oscon/tutorial/#s105 that give a first idea how to build a custom field.
The result can be found on http://www.djangosnippets.org/snippets/865/ or here below.
Leave a Comment