#3257: [patch] added choice fields that return models
-------------------------------------------------+--------------------------
Reporter: Honza Kr�l <[EMAIL PROTECTED]> | Owner: adrian
Status: new | Component: django.newforms
Version: | Resolution:
Keywords: | Stage: Design decision needed
Has_patch: 1 | Needs_docs: 1
Needs_tests: 1 | Needs_better_patch: 1
-------------------------------------------------+--------------------------
Comment (by [EMAIL PROTECTED]):
I have started working on tests for this patch, however I do have a few
questions after writing most of the tests for the two new Fields:
1. Currently, even if the value passed to the clean function is in the
choices list, but is not a pk for the model, it will raise an error. Is
this expected behavior? Do we want some sort of check on field
construction to check that all of the choices are in fact pks for the
given model?
2. Setting required=False in either of the new fields does nothing,
because when the clean function is called, if it doesn't find a result for
that value, it will raise an exception. Should required=False be an
option on these fields, or should the code be changed to allow for it?
3. The section of the patch regarding django/newforms/models.py is no
longer needed as far as I can tell.
Other than those few fairly minor questions, test creation is going quite
well.
--
Ticket URL: <http://code.djangoproject.com/ticket/3257#comment:4>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django
updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---