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 ex开发者_开发问答ist?
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.
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").
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/
精彩评论