Exemple #1
0
def task_create(request):
	#get descriptors and merchants
	api=ControllerAPI(request)
	descriptors=api.getmoduledescriptors()
	merchants=api.getmerchants()

	#template context
	context=_get_context(request,content="content_task_addedit",descriptors=json.dumps(descriptors),merchants=json.dumps(merchants))

	#render
        return HttpResponse( get_template('template_content.html').render(Context(context)) )
Exemple #2
0
def create_task_from_template(request,id):
	#get template
	template=TaskTemplate.get(id=id)

	#get descriptors and merchants
	api=ControllerAPI(request)
	descriptors=api.getmoduledescriptors()
	merchants=api.getmerchants()

	#template context
	context=_get_context(request,content="content_task_addedit",descriptors=json.dumps(descriptors),merchants=json.dumps(merchants),template=template,tasks=json.dumps(template.gettasks()))

	#render
        return HttpResponse( get_template('template_content.html').render(Context(context)) )