hekevintran
hekevintran

Reputation: 23732

Writing custom Django form fields and widgets

Django has very good documentation that describes how to write custom database fields and custom template tags and filters. I cannot find the document that describes how to write custom form fields and widgets. Does this document exist?

The way I've been able to write custom form fields and widgets is by reading the Django source code and imitating what I see there. I know that there are still things about implementing fields and widgets that I do not completely understand because I have not read any high level document that describes their interfaces.

Upvotes: 9

Views: 1031

Answers (2)

gregory
gregory

Reputation: 21

personally I have found the docs on form validation to be very helpful to write custom form fields or to customize form-wide validation (since it's really all about validation isn't?)

https://docs.djangoproject.com/en/dev/ref/forms/validation/

Upvotes: 0

Conley Owens
Conley Owens

Reputation: 9173

I have not found any good documentation (especially for widgets). I would suggest continuing to do it the way you are, and google specific problems (e.g., "creating a MultiValueField and MultiWidget").

Upvotes: 3

Related Questions