On Tue, 8 Sep 2020 at 03:54, Asif Saif Uddin <auvipy@gmail.com> wrote:
any help? I can share the full function
I've poked around some of these dark corners, but only since the late 2.x series. After a bit of searching this find-the-field-that-connects-a-model-to-a-through-model and the linked
suggest these are/were private APIs and AFAIK, the best you can do is try to figure out what the old code was doing, and rework them using the likes of:
- self._meta.related_objects
- self._meta.fields_map
- self._meta.local_many_to_man
and the other similarly named fields. One thing to note: if a field x points to a *set* of objects, you won't find a "self.x", but rather a "self.x_set" which must be followed using a query such as "self.x_set.all()" rather than a simple field dereference.
HTH, Shaheed
On Wednesday, August 19, 2020 at 3:42:09 AM UTC+6 vickkymb...@gmail.com wrote:--I don't bro i just started new in DjangoVictorOn Tue, Aug 18, 2020, 3:46 PM Asif Saif Uddin <auv...@gmail.com> wrote:Hi,I have got an old project of django 1.8 which use codes likelinks = [rel.get_accessor_name() for rel in self._meta.get_all_related_objects()]How would I upgrade this code snippets to django 2.2 LTS?TIA--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c408d424-7c94-43de-beae-4071d424e2ecn%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e83b7021-3158-41b2-b48f-33d9f45270a6n%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHAc2jfeKWgiD97bYYePPAv0zMm2zKXqnirLsM5fUm%3DEC2xRfA%40mail.gmail.com.
No comments:
Post a Comment