Re: Override QuerySet.none()

2010-07-27 Thread gs794
not be the most elegant solution. I'll look into the Manager implementation as you suggested. Thanks. On Jul 27, 5:50 pm, bruno desthuilliers wrote: > On 27 juil, 06:27, gs794 wrote: > > > > > Hi all, > > > I'm having trouble overriding QuerySet.none()

Override QuerySet.none()

2010-07-26 Thread gs794
Hi all, I'm having trouble overriding QuerySet.none() (code below)... Works if I rename the method to almost anything but "none". class QuerySetManager(models.Manager): def get_query_set(self): return self.model.QuerySet(self.model) def __getattr__(self, name): return getattr(self.ge

Re: DatabaseError: subquery has too many columns

2010-07-26 Thread gs794
The query it produces is pretty close to what you'd expect though - apart from the extra column. The reason i'd like it to work is because i'm applying filters based on context using some complicated logic that sometimes applies the "none" method. Should I ticket this? In terms of a quick hack, d

DatabaseError: subquery has too many columns

2010-07-25 Thread gs794
Hi all, Just came across this error. class Test(models.Model): name = models.CharField(max_length=20) test = Test(name='bob') test.save() pks = Test.objects.none().values('pk').query print Test.objects.exclude(pk__in=pks) DatabaseError: subquery has too many columns The query: SELECT "err