Django forms: where is POST data received?

Posted by Rosarch on Stack Overflow See other posts from Stack Overflow or by Rosarch
Published on 2011-01-17T20:51:12Z Indexed on 2011/01/17 20:53 UTC
Read the original article Hit count: 110

Filed under:
|
|

I have a widget that allows user to enter data for a model field. The data in the form can't be directly converted to Python - it requires some coercion. Where do I put this code? Is the widget responsible for translating its post data to a python value? The field itself?

I thought that maybe value_from_datadict() would be correct, but now it looks like that serves a different purpose.

(I'm using the form in the admin interface, if it makes any difference.)

© Stack Overflow or respective owner

Related posts about python

Related posts about django