def advanced(request): d = {'menu_item': 'ui_home.learn'} d["testPrefixes"] = uic.testPrefixes d['prefixes'] = sorted(uic.testPrefixes, key=lambda p: p['namespace'].lower() ) #must be done before calling form processing d = ui_create.adv_form(request, d) return uic.renderIdPage(request, 'demo/advanced', d)
def advanced(request): d = {'menu_item': 'ui_create.advanced'} d["testPrefixes"] = uic.testPrefixes user = userauth.getUser(request) if user.isSuperuser: shoulders = [ s for s in ezidapp.models.getAllShoulders() if not s.isTest ] else: shoulders = user.shoulders.all() d["prefixes"] = sorted([{ "namespace": s.name, "prefix": s.prefix } for\ s in shoulders], key=lambda p: ("%s %s" % (p["namespace"], p["prefix"])).lower()) if len(d['prefixes']) < 1: return uic.render(request, 'create/no_shoulders', d) d = adv_form(request, d) return uic.renderIdPage(request, 'create/advanced', d)