On Fri, 19 Feb 2010 07:00:36 -0800, manixor wrote: <snip> > > The very big problem is, when I loop into object on template, in the > monday field is not enymore the Day instance, but the string 1. How can > I convert to an json object the week object, and to keep the instance of > the inherits class, or how can I modify the ForeignField model, to point > to another field, like name in my case and not to the pk, which is an > integer in my case?
Hello Maxinor, If I understand your problem correctly, I can think of two ways around this: (1) Use the development release (1.2, the natural keys (http://docs.djangoproject.com/en/dev/topics/serialization/#natural-keys) enhancement may do what you want. (2) Set Day.name to have primary_key=True, that way the name will be serialised instead of the automatically generated primary key. As you have already set Day.name to be unique making it the primary key shouldn't prove to be a problem. Cheers, Kev -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.