What is the nice way to limit/ omit column field displays

0 views
Skip to first unread message

dakila

unread,
Jun 8, 2010, 2:55:18 AM6/8/10
to rum-discuss
Hi All,

Is there an option in rum similar to __omit_fields__ in sprox?

Currently what I do to achieve 'exclude a field' is iterate on the
table's columns and 'policy.register' them individually for each
actions 'show' and 'index' . But Im noticing a slow response on the
first request, but it is only on the first request , but after that
everything rocks big time :)


for table in tables:
for action in tg.config.get('rum_permission_view')
['actions']:
if 'User' in str(table) and action in
('index','show'):
for c in class_mapper(table).iterate_properties:
if hasattr(c,'key') and
getattr(c,'key')=='password':
pass
elif hasattr(c,'key'):
p.register(viewer, obj=table,
action=action, attr=c.key)
else:
pass
else:
p.register(viewer,obj=table,action=action)



Regards,
Dakila

Michael Brickenstein

unread,
Jun 8, 2010, 3:26:31 AM6/8/10
to rum-discuss
Hi!
I included an example here:
http://bitbucket.org/brickenstein/rum-policy/changeset/b1f71f0c7cf0

Indeed exclusions are very essential. We should consider to make it a
little bit more unmagical.

By the way, I suppose, that the slowness might also be prevented by
initialization and importing everything essential on app server start.

Cheers,
Michael

dakila

unread,
Jun 9, 2010, 1:20:52 PM6/9/10
to rum-discuss
Hi Michael,

Thanks for your example, was able exclude the display of the password
attribute. The reduced number of 'register' calls did made the first
request faster.

Regarding exclusions, I think the exclusion example is of great help
already.


Regards,
Dakila
Reply all
Reply to author
Forward
0 new messages