def user_basic_view(context, request): properties = item_view_object(context, request) filtered = {} for key in ['@id', '@type', 'uuid', 'lab', 'title']: try: filtered[key] = properties[key] except KeyError: pass return filtered
def user_page_view(context, request): if request.has_permission('view_details'): properties = item_view_object(context, request) else: item_path = request.resource_path(context) properties = request.embed(item_path, '@@object') for path in context.embedded: expand_path(request, properties, path) calculated = calculate_properties(context, request, properties, category='page') properties.update(calculated) return properties