Changes between Initial Version and Version 1 of Ticket #31874


Ignore:
Timestamp:
Aug 10, 2020, 4:41:19 AM (4 years ago)
Author:
Mariusz Felisiak
Comment:

Thanks for the report, however I cannot reproduce described issue.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31874

    • Property Resolutionworksforme
    • Property Status newclosed
  • Ticket #31874 – Description

    initial v1  
    11Let's say you have a table
     2{{{
    23class Foo(models.Model):
    34    obj = models.ForeignKey('Bar', on_delete=models.CASCADE)
     
    67    class Meta:
    78        unique_together = ('obj', 'x')
    8 
    9 When you use Foo.objects.update_or_create(obj=instance, x=1, defaults={'y': 'test'}), the SQL generated will omit the obj_id from WHERE clause. On the other hand, when obj_id=10 is used, it is used in WHERE clause.
     9}}}
     10When you use `Foo.objects.update_or_create(obj=instance, x=1, defaults={'y': 'test'})`, the SQL generated will omit the obj_id from WHERE clause. On the other hand, when obj_id=10 is used, it is used in WHERE clause.
Back to Top