def get_element(request, element_id): element = Widget.get(element_id) if element is None: raise Http404() else: return element
def get_direct_element_children(node): from megacms.basewidgets.widgetmodels import Widget return (Widget.all() .filter('element_parent =', node.key()) .order('element_order') .fetch(limit=None))