Hi
I have not idea how to describe my problem, so I show pice of code:
class Aaa(models.Model):
name = models.CharField(max_length=200, unique=True)
is_active = models.BooleanField()
class Meta:
ordering = ('name',)
def doMagic(self):
date = '2010-05-04'
//here I need to take 10 conencted Bbb objects whcich data is less
then date
previous10days = self.bbb_set.filter(Bbb.date <
date).order_by('data')
class Bbb(models.Model):
date = models.DateField()
value = models.DecimalField(max_digits=7, decimal_places=2)
aaa = models.ForeignKey(Aaa)
a = Aaa()
a.doMagic throw error that Bbb.date is undefined - what can be wrong?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.