Object handler fields override local field list

Issue #192 open
created an issue

When defining a handler for one object that relates to another, any field that references an object with a handler defined are overridden by the referenced object's handler.



class HandlerFoo(BaseHandler):
model = Foo

class HandlerBar(BaseHandler):
model = Bar
fields = ('blah', ('foo', 'zing', 'zang'))

Assuing 'foo' is a foreign key referencing a 'Foo' object, When the response for HandlerBar is rendered, all the fields on Foo are rendered, even though I specifed only the 'zing' and 'zang' fields.

Local field specs should always have precedence over the field spec on other handlers.

The attached patch changes the precedence.

Comments (5)

  1. Fabian Sturm

    I recently upgraded to Django 1.4 and Piston 7c90898072ce (for 1.4 compatibility) and ran into the same problem. I just applied the patch from above and everything seems to be working again.

    So my question is, will this patch be applied sometimes, or is there any other way I can get the "old" behaviour back?

  2. Log in to comment