Exemplo n.º 1
0
def get_list_branch_post1(request):
	if not user_is_logged_in(request): return user_not_logged()
	proc_id = request.match_info.get('proc_id')
	branch = []
	doc = request.db.tree.find_one({'_id':'tree:'+proc_id})
	tree = doc['tree']
	branch.append({"id":"", "title":"-"})
	for res in tree:
		branch.append({"id":res, "title":ct(request, tree[res]['title'])})
	return response_json(request, {"result":"ok", "list_branch":branch })
Exemplo n.º 2
0
async def get_list_rb_post(request):
	if not user_is_logged_in(request): return user_not_logged()
	all_view = []
	# type = get_post('type')
	for res in request.db.map.find({'type':'templ'}):
		title = ct(request, res['conf']['title'])
		if 'owner' in res['conf'] and res['conf']['owner'] != '_':
			mt = get_mt(request, res['conf']['owner'])
			if not mt: continue
			title = '%s: %s' % (ct(request, mt['conf']['title']), title)
		all_view.append({'_id':res['_id'], 'title':title })
	return response_json(request,  {"result":"ok", "list_rb":all_view})
Exemplo n.º 3
0
async def get_list_cascad_doc_post(request):
	if not user_is_logged_in(request): return user_not_logged()
	# proc_id = get_post('proc_id')
	data = get_post(request)
	rel_field  = data['rel_field']
	doc_id     = data['doc_id']
	proc_id    = data['rb_id']
	docs = []

	doc = request.db.doc.find_one({'_id':doc_id})
	filter_name_id = ct(request, doc['doc'][rel_field])

	owner_id_ware_class = request.db.doc.find_one({'_id':filter_name_id})['owner']
	for res in request.db.doc.find({'doc_type':proc_id, 'owner':owner_id_ware_class, 'doc.title':filter_name_id}):
		title = get_doc_title(request, res, res['_id'])
		docs.append({ "id":res['_id'], "title":title })
	return response_json(request,  {"result":"ok", "list_doc":json.dumps(docs)})
Exemplo n.º 4
0
async def get_list_doc_post(request):
	if not user_is_logged_in(request): return user_not_logged()
	data = get_post(request)
	rb_id = data['rb_id']
	doc = get_list_doc_( request, rb_id )
	return response_json(request,  {"result":"ok", "list_doc":json.dumps(doc)})