prev = self.bbb_set.filter(date__lt=date)
Take a look to field lookup rules:
http://docs.djangoproject.com/en/dev/topics/db/queries/#field-lookups-intro
Excerpts from serek's message of Wed Feb 16 20:51:05 -0200 2011:
--
Matías Aguirre <matias...@gmail.com>
Hi Serek,
Try this
def doMagic(self):
date = '2010-05-04'
#//here I need to take 10 conencted Bbb objects whcich data is less then date
previous10days = Bbb.objects.filter(date__lt=date).order_by('data')
Also read up about managers http://docs.djangoproject.com/en/1.2/topics/db/managers/ in case you should consider using it (depending upon how much magic is required from your function).
Regards
Chris
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.