Changes between Initial Version and Version 1 of Ticket #28944, comment 7


Ignore:
Timestamp:
Jan 5, 2018, 12:50:31 PM (7 years ago)
Author:
Tim Graham

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28944, comment 7

    initial v1  
    1212    bla = models.TextField()
    1313    a = models.ForeignKey(a, on_delete=models.CASCADE)
    14 
    15 and then if you want to do: B.objects.all().select_related('a').select_for_update(of=('self', 'a')) , that works
    16 but the same with a values_list: B.objects.all().select_related('a').select_for_update(of=('self', 'a')).values_list('pk', 'a__foo'), that does not work and results in something like (I have different class names in my code)
    17 
     14}}}
     15and then if you want to do: `B.objects.all().select_related('a').select_for_update(of=('self', 'a'))`, that works
     16but the same with a values_list: `B.objects.all().select_related('a').select_for_update(of=('self', 'a')).values_list('pk', 'a__foo')`, that does not work and results in something like (I have different class names in my code)
     17{{{
    1818Traceback (most recent call last):
    1919  File "<console>", line 2, in <module>
     
    3535    ', '.join(_get_field_choices()),
    3636django.core.exceptions.FieldError: Invalid field name(s) given in select_for_update(of=(...)): mdm_client. Only relational fields followed in the query are allowed. Choices are: self.
    37 
    38 
    3937}}}
Back to Top