jqgrid and django models

Posted by Andrew Gee on Stack Overflow See other posts from Stack Overflow or by Andrew Gee
Published on 2009-10-30T04:17:52Z Indexed on 2010/12/23 19:54 UTC
Read the original article Hit count: 362

Filed under:
|

Hi,

I have the following models

class Employee(Person):  
  job = model.Charfield(max_length=200)  
class Address(models.Model):
  street = models.CharField(max_length=200)
  city = models.CharField(max_length=200)
class EmpAddress(Address):
  date_occupied = models.DateField()
  date_vacated = models.DateField()
  employee = models.ForeignKey()

When I build a json data structure for an EmpAddress object using the django serialzer it does not include the inherited fields only the EmpAddress fields. I know the fields are available in the object in my view as I can print them but they are not built into the json structure.

Does anyone know how to overcome this?

Thanks
Andrew

© Stack Overflow or respective owner

Related posts about django

Related posts about jqgrid