#23918: Built in functions override custom functions in related manager
----------------------------------------------+--------------------
Reporter: dracos | Owner: nobody
Type: Uncategorized | Status: new
Component: Database layer (models, ORM) | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
The fix for #23611 (released in Django 1.7.1) broke some relatively old,
but stable and working, code that is okay on Django 1.4 up to and
including 1.7. You can see the difference between 1.7 and 1.7.1 in this
Travis build on a minimal Django project: https://travis-ci.org/dracos
/django-related-bug/builds/42139875
The issue appears to be that now update_or_create is made available on
related managers, it overrides the method defined on the model manager.
Which is fine, but unexpected, especially as it was okay in 1.7 itself. I
can just rename the method (and/or switch it to behave more identically to
1.7's method of the same name for eventual replacement with it), but I
thought it was worth raising here as a possible confusion, or just to
check if custom functions of the same name should be overriding built in
functions.
--
Ticket URL: <https://code.djangoproject.com/ticket/23918>
Django <https://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 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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/049.f13ae76a7ced1e3265f5ec164742ac26%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.