Hi,
In my application I'm trying to serialize the following model to json:

class Node(models.Model):
  name = models.CharField(db_column="NAME",
                          max_length=30,
                          db_index=True)
  description = models.CharField(db_column="DESCRIPTION",
                          db_index=True,
                          max_length=255)
  registrationDate=models.DateField(db_column="REGISTRATION_DATE",
                          db_index=True)
  parentNodeObject = models.ForeignKey("self", db_column="PARENT",
related_name="parent_fk")

  rootNodeObject= models.ForeignKey("self", db_column="ROOT",
related_name="root_fk")

Before I serialize the instances to json I retreived all the nodes:
models.Node.objects.select_related
('parentNodeObject','rootNodeObject')
The problem is that for all the parentNodeObjects and rootNodeObjects
retrieved from DB, in the json string appears only the model's id.
I don't know if this is normal or not but I'd like to have access to
all the properties of all the objects retrieved,
even if the final json string is huge.
Is this possible?
I'll appreciate any thoughts regarding this subject.

Thank you,
srn


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to