Changes between Initial Version and Version 2 of Ticket #11472
- Timestamp:
- Jul 13, 2009, 9:41:15 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #11472 – Description
initial v2 4 4 5 5 I have to Models both with relationships to Users, cutting down to relavant parts: 6 6 {{{ 7 7 class Project(models.Model): 8 8 owner = models.ForeignKey(User) … … 10 10 class Release(models.Model): 11 11 owner = models.ForeignKey(User) 12 12 }}} 13 13 In my view methods when I use: 14 14 {{{ 15 15 u = User.objects.exclude(project__owner__isnull=True, release__owner__isnull=True).distinct() 16 16 }}} 17 17 it returns an error of "no such column: U1.owner_id" 18 18 19 19 Alternatively when I try: 20 20 {{{ 21 21 u = User.objects.filter(project__owner__isnull=False).distinct() | User.objects.filter(project__owner__isnull=False).distinct() 22 22 }}} 23 23 This returns a list of ALL users regardless being an owner of a project or release. Using either of those queries alone also returns all users. 24 24