--
You received this message because you are subscribed to the Google Groups "django-piston" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-pisto...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-piston?hl=en.
Each entry includes it's day which in turn includes it's entry, each of which include their day which... And so on until you hit the recursion depth. Don't include the day in the fields returned I the entry set, if that makes sense.
~ Justin
Happy to share if wanted.
Malcolm
Sent from my iPhone, please excuse any typos
On 16 Mar 2011, at 19:28, Dave McKenna <davemc...@gmail.com> wrote:
> I've installed the tip, and related fields are being emitted. But for
> the example below, I noticed that the fields specified on 'entry_set'
> in the DayHandler (in this case just 'id') are being ignored. Instead
> the fields specified on the EntryHandler (in this case 'id',
> 'meal_type', and 'meal') are being emitted. And similarly, 'id' and
> 'name' are both ignored for 'meal_type' and 'meal' on EntryHandler.
>
> class DayHandler(BaseHandler):
> allowed_methods = ('GET',)
> model = Day
> fields = ('name', 'id', ('entry_set',('id',),),)
>
> class EntryHandler(BaseHandler):
> allowed_methods = ('GET',)
> model = Entry
> fields = ('id', ('meal_type', ('id','name',),), ('meal',
> ('id','name',),), )
>
> Not the end of the world, but thought I'd bring it up to see if
> there's anything that can be done to prevent the fields from being
> ignored, unless this is just the way it is with tip.
>
> Thanks - Dave
>
>
> On Mar 15, 9:15 pm, Dave McKenna <davemckenn...@gmail.com> wrote:
>> Just realized the title of this post should have been:
>>
>> "Handler outputs <RelatedManager object> instead of related object"
>>
>> Can't see a way to change it - so this clarification is the best I can
>> do.
>>
>> Dave
>>
>> On Mar 15, 9:05 pm, Dave McKenna <davemckenn...@gmail.com> wrote:
>>
>>
>>
>>
>>
>>
>>
>>> Justin - yup you're right. Removing days does the trick.
>>
>>> But if I *want* days - Erik, your patch works great!
>>
>>> I can do what I need to do now - thanks everyone!
>>
>>> Dave
>>
>>> On Mar 15, 4:57 pm, Erik LaBianca <erik.labia...@gmail.com> wrote:
>>
>>>> I ran into the same thing, my bitbucket fork has a recursion stack that seems to work.
>>
>>>> https://bitbucket.org/easel/django-piston
>>
>>>> orhttps://bitbucket.org/easel/django-piston/changeset/f92035638c9fforjustthe patch.