On Tue, 2008-07-22 at 04:21 -0700, Michael Elsdörfer wrote:
> Previously, get_FIELD_display(), for a blank or unknown value of
> FIELD, return the value unchanged, e.g. say None or an empty string.
> 
> After the change, it returns the automatically inserted blank choice
> (-------). This is due to it now using field.flatchoices, which is
> dynamically generated through the get_choices() method, whereas it
> previously just used field.choices, which contains the unmodified
> tuple the field receives through __init__.
> This may also be an unwanted discrepancy between the two attributes.
> 
> Was it a conscious change? I think I did sort of prefer the old
> behaviour. I'm using get_field_display in a generic scenario that
> makes it hard to check the original value.

This sounds like an unintended side-effect and probably worth opening a
ticket for. That change was meant to add a new feature, not change
existing code.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to