RecordViewBase __add_fields__

5 views
Skip to first unread message

ozwyzard

unread,
Jun 12, 2011, 11:45:50 PM6/12/11
to sprox
Does sprox support __add_fields__ for RecordViewBase?

class record_view_type(MyRecordViewBase):
__model__ = ResourceNote
__add_fields__ = {'f_Author': None}
__limit_fields__ = ['f_Author', 'Name', 'Summary', 'Text']
__field_order = ['f_Author', 'Name', 'Summary', 'Text']
__headers__ = {'f_Author' : 'Author'}

class record_view_filler_type(MyRecordFiller):
__model__ = ResourceNote
__add_fields__ = {'f_Author': None}
def f_Author(self, obj, **kw):
return pmo.objattr(cls=User, id=obj.Author,
attr='user_name')

With the above code, I verified that f_Author() is indeed invoked and
the value is added to the values dictionary. I also verified that the
self.___widget__ in viewbase.py has the f_Author Widget as a child, as
in Widget('f_Author', children=[], **{}).

But the value for f_Author is *not* getting rendered.

Incidentally, similar functionality for the get_all() data_grid *does*
get rendered.

I have spent many hours digging through this. If anyone has further
pointers, kindly reply.

Thanks!
ozwyzard
Reply all
Reply to author
Forward
0 new messages