#19399: Do not recreate RelatedObject instances
-------------------------------------+-------------------------------------
     Reporter:  KJ                   |                    Owner:  KJ
         Type:                       |                   Status:  new
  Cleanup/optimization               |                  Version:  master
    Component:  Database layer       |               Resolution:
  (models, ORM)                      |             Triage Stage:  Accepted
     Severity:  Normal               |      Needs documentation:  0
     Keywords:                       |  Patch needs improvement:  0
    Has patch:  0                    |                    UI/UX:  0
  Needs tests:  0                    |
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by akaariai):

 * has_patch:  1 => 0
 * easy:  1 => 0
 * stage:  Ready for checkin => Accepted


Comment:

 I committed the validation and caching changes, without the tests.

 Personally, I don't think the tests add that much value. They test 3
 specific places for not creating RelatedObject instances, but we have
 still the rest of codebase uncovered. It is impossible to test that
 RelatedObjects aren't recreated anywhere in the codebase by testing
 specific places for that. In addition, if we ever decide to alter the
 underlying implementations, the tests would be noise errors. (I am
 currently wondering why we need both field.rel and field.related. Seems
 strange...).

 I also removed the self.rel_name line from the forms/models.py. It is
 dead-code.

 I don't feel comfortable doing the alternatebook name change. It *will*
 break existing public-API using code, at least tests, as we change what
 values can be passed in the request.POST. Those using public APIs are more
 important than those who want to hack with the internals.

 So, leaving this open if you want to tackle the AlternateBook issue. It
 doesn't seem to be an easy one to tackle.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19399#comment:12>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to