Changes between Initial Version and Version 1 of Ticket #19580, comment 47


Ignore:
Timestamp:
Jan 24, 2022, 4:00:33 AM (3 years ago)
Author:
raydeal

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #19580, comment 47

    initial v1  
    77
    88I have also tested previous patch (https://github.com/django/django/pull/13784) locally.
    9 I couldn't find correct rules because M2M worked as always, only changed behaviour of FK. When object is not saved it raises ValueError, when saved but related value is Null returns <QuerySet []>, which is not consistent for me. Why?
    10 Base on doubt from #17541 https://code.djangoproject.com/ticket/17541#comment:8 I asked myself: What is the difference between not saved object with id (pk) refrerenced from other object and saved object with field containing Null value referenced by other object, through FK both, from the relation point of view?
    11 There is no difference - both of them have Null value and making related query in both cases doesn't make sens.
     9I couldn't find correct rules because M2M worked as always, only changed behaviour of FK. When object is not saved it raises ValueError, when saved but related value is None returns <QuerySet []>, which is not consistent for me. Why?
     10Base on doubt from #17541 https://code.djangoproject.com/ticket/17541#comment:8 I asked myself: What is the difference between not saved object with id (pk) refrerenced from other object and saved object with field containing None value referenced by other object, through FK both, from the relation point of view?
     11There is no difference - both of them have None value and making related query in both cases doesn't make sens.
    1212
    1313So finally I came to the conclusion that what M2M is doing is correct - in both cases it raises error - and it meet some of The Zen of Python rules, I think :)
Back to Top