How can it be complicated ? I thought it's just something like
getattr(MyModel, field_name) to get value and
model._meta.get_field(unique_field) to get the field instance..
Where can I find explanation for what you mean? and where can I find the
PK code you're referring to?
Field updates for multi-table models are internally split into multiple
tables updates, if the fields reside on several tables from the
inheritance chain. The identity of records is matched against pk values
stored in OneToOne xxx_ptr fields on the subtables. You can find the
construction logic for this in UpdateQuery.get_related_updates
(https://github.com/django/django/blob/49b470b9187b6be60e573fed08c8f4a87f133750/django/db/models/sql/subqueries.py#L124).
With using a different field for record identification without having
the pk (thus from degenerated model instances) this wont work anymore
(note it directly refers to pk__in selection). Most likely you will have
to do an explicit db roundtrip resolving "some_unique_field -> pk"
upfront to keep it working for multi-table spanning updates. Thats where
the impl might get complicated/messy.
Thank you. I was asked to re-open the ticket if there's an agreement to
add the update..
Should I re-open it or we will need more than one person to agree on the
update ?
(I'm sorry, this is my first contribution)
You def. should get for more feedback, a single opinion does not mean
much here.
Cheers, jerch
--
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 django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/92338ab4-e016-1a36-70c3-097f25f55e50%40netzkolchose.de.