Re: Serializing objects with a many-to-many reference

2010-03-09 Thread Russell Keith-Magee
On Wed, Mar 10, 2010 at 1:57 AM, Jesus Mager wrote: > 2010/3/2 Russell Keith-Magee : >> On Wed, Mar 3, 2010 at 12:46 AM, Jim N wrote: >>> Hi, > >> The short answer is you can't - at least, not out of the box. This is >> a feature that has been proposed several times [1] in the past. >> Django's s

Re: Serializing objects with a many-to-many reference

2010-03-09 Thread Jesus Mager
2010/3/2 Russell Keith-Magee : > On Wed, Mar 3, 2010 at 12:46 AM, Jim N wrote: >> Hi, > The short answer is you can't - at least, not out of the box. This is > a feature that has been proposed several times [1] in the past. > Django's serializers are primarily designed for use in the testing > sy

Re: Serializing objects with a many-to-many reference

2010-03-03 Thread Russell Keith-Magee
On Thu, Mar 4, 2010 at 1:36 AM, Jim N wrote: > I just came across manager methods in the docs: > > http://docs.djangoproject.com/en/dev/topics/db/managers/#adding-extra-manager-methods > > Could I have used these to create a seriallizable QuerySet, by > defining, say, a with_user() method inside t

Re: Serializing objects with a many-to-many reference

2010-03-03 Thread Jim N
I just came across manager methods in the docs: http://docs.djangoproject.com/en/dev/topics/db/managers/#adding-extra-manager-methods Could I have used these to create a seriallizable QuerySet, by defining, say, a with_user() method inside the Questions model? -Jim On Mar 3, 10:21 am, Jim N wr

Re: Serializing objects with a many-to-many reference

2010-03-03 Thread Jim N
Thanks Russell, I ended up writing it myself - breaking the QuerySet into a dictionary, grabbing and plugging in the information from the other model, and then re-serializing it not using the serializer.serialize, but the simplejson.dumps. I'll check out DjangoFullSerializers for future reference

Re: Serializing objects with a many-to-many reference

2010-03-02 Thread Russell Keith-Magee
On Wed, Mar 3, 2010 at 12:46 AM, Jim N wrote: > Hi, > > I am writing a question-and-answer app which serializes data in JSON. > I have Question, User, and Asking models.  Asking is the many-to-many > relationship table for Question and User, because the Asking > relationship may be more complicate