I was wondering whether there would be support for changes to some of the 
methods on the field API...

1. Rename `Field._get_val_from_obj` and `Field.value_from_object` methods

These two methods do exactly the same thing (except one returns a default 
value if available). In addition, the 'value_from_object' is confusingly 
named, as it performs a completely different function than 
`value_to_string` and `to_python`, but is named similarly.

Both of these methods should be deprecated and a new method 
`Field.get_field_value(model_instance, use_default=True)` should be added. 
If `use_default` is provided and `True`, then the implementation should 
redirect to `field.get_default()`, otherwise an AttributeError would be 
raised.

2. Rename `Field.save_form_data`

`Field.save_form_data()` should be renamed to `Field.get_field_value()` for 
symmetry with `Field.get_field_value()`.
 
3. `Field._get_cache_name()` and should use field.attname.

I'm planning to submit a PR in the next couple of days that makes 
`field.name` not necessarily unique. All non-hidden fields will still be 
unique, so it won't cause a problem with the `model._meta.get_field()` API, 
but it will cause problems if fields can overwrite each others cached 
values. This should not be a breaking change, since _get_cache_name is an 
implementation detail.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/12856c2f-66c9-4b29-b97d-6394c75d9c5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to