Changes between Initial Version and Version 1 of Ticket #29697
- Timestamp:
- Aug 22, 2018, 8:35:57 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29697
- Property Triage Stage Unreviewed → Accepted
- Property Summary Missing FROM-clause entry for table → Complex query crashes with "missing FROM-clause entry for table"
-
Ticket #29697 – Description
initial v1 5 5 6 6 {{{ 7 from django.db import models 8 from django.contrib.postgres.fields import JSONField 9 10 class Company(models.Model): 11 ... 12 7 13 class Status(models.Model): 8 14 ... 9 15 company = models.ForeignKey( 10 'customauth.Company',16 Company, 11 17 on_delete=models.CASCADE) 12 18 key = models.SlugField(max_length=255) … … 16 22 ... 17 23 company = models.ForeignKey( 18 'customauth.Company',24 Company, 19 25 on_delete=models.CASCADE, 20 26 related_name='employees', 21 27 db_index=True) 22 permissions = postgres.fields.JSONField(blank=True, default=list)28 permissions = JSONField(blank=True, default=list) 23 29 is_superuser = models.BooleanField(default=False) 24 30 ... 25 31 26 class Company(models.Model):27 ...28 32 }}} 29 33 … … 31 35 32 36 {{{ 37 from django.db.models import Q, Value 38 from django.db.models.functions import Concat 39 33 40 Status.objects.filter( 34 41 Q(company__employees__is_superuser=True) |