You are. of course, correct Tom. I've never once used it that way but that is the published api/contract as you stated. Possibly it should have insisted that the programmer designate which terms are search terms separate from those which are content only rather than making it optional. But my proposal does indeed result in a very different semantic ultimately. Thanx for the feedback. Guess I'll keep wrapping it outside of the core code.
-- Ben On Thu, Aug 28, 2014 at 5:35 PM, Tom Evans <tevans...@googlemail.com> wrote: > On Wed, Aug 27, 2014 at 10:19 PM, Benjamin Scherrey > <proteus...@gmail.com> wrote: > > I don't believe the functionality is backwards incompatible at all unless > > I'm missing something. The new behavior of automatically selecting the > > optimal search field (prioritized by pk first then by any discovered > field > > marked as unique) would only occur if the 'default' parameter was None. > > So, if I passed in kwargs={'pk': 7, 'foo': 'bar', 'wibble': 'quuz'}, > with "foo" and "wibble" being non-indexed fields, then the query that > would be run by get_or_create to determine whether the item exists > would differ in your new version. > > This means it is not backwards compatible, as if I passed in those > arguments to get_or_create(), then I expect one of three things to > happen: > > 1) the object returned to have those values > 2) an object is newly created that has those values > 3) an error occurs because an object could not be created that has > those values. > > The proposed change breaks that contract, eg it would simply return > whatever item has the pk 7, regardless of 'foo' or 'wibble' > attributes. > > Cheers > > Tom > > -- > You received this message because you are subscribed to the Google Groups > "Django developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-developers+unsubscr...@googlegroups.com. > To post to this group, send email to django-developers@googlegroups.com. > 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/CAFHbX1J-EL%3DPV2x9dZevZzcaWG%2BE30O18nf3gFrLQKjFoK1O9A%40mail.gmail.com > . > For more options, visit https://groups.google.com/d/optout. > -- Chief Systems Architect Proteus Technologies <http://proteus-tech.com> Chief Fan Biggest Fan Productions <http://biggestfan.net> Personal blog where I am not your demographic <http://notyourdemographic.com>. This email intended solely for those who have received it. If you have received this email by accident - well lucky you!! -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. 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/CAHN%3D9D6CbRJccYZwRDgGv6wfoy5RaU%3D8_PTLyJ3DC%3D26S1uZQw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.