queries in django

Posted by Hulk on Stack Overflow See other posts from Stack Overflow or by Hulk
Published on 2010-04-09T10:41:43Z Indexed on 2010/04/09 10:43 UTC
Read the original article Hit count: 634

How to query Employee to get all the address related to the employee, Employee.Add.all() doe not work..

 class Employee():
    Add = models.ManyToManyField(Address)
    parent = models.ManyToManyField(Parent, blank=True, null=True)

class Address(models.Model):
   address_emp = models.CharField(max_length=512)
   description = models.TextField()

   def __unicode__(self):
   return self.name()

© Stack Overflow or respective owner

Related posts about django

Related posts about django-views