@check_job_access_permission()
@check_job_edition_permission()
def create_coordinator_dataset(request, coordinator):
 dataset = Dataset(coordinator=coordinator)
 response = {'status': (-1), 'data': 'None'}
 if (request.method == 'POST'):
  dataset_form = DatasetForm(request.POST, instance=dataset, prefix='create')
  if dataset_form.is_valid():
   dataset_form.save()
   response['status'] = 0
   response['data'] = (reverse('oozie:edit_coordinator', kwargs={'coordinator': coordinator.id}) + '#listDataset')
   request.info(_('Dataset created'))
 else:
  response['data'] = _('A POST request is required.')
 if (response['status'] != 0):
  response['data'] = render('editor/create_coordinator_dataset.mako', request, {'coordinator': coordinator, 'dataset_form': dataset_form, 'dataset': dataset}, force_template=True).content
 return JsonResponse(response, safe=False)

@ check_job_access_permission ( ) @ check_job_edition_permission ( ) def create_coordinator_dataset ( request , coordinator ) : dataset = Dataset ( coordinator = coordinator ) response = { 'status' : ( - 1 ) , 'data' : 'None' } if ( request . method == 'POST' ) : dataset_form = DatasetForm ( request . POST , instance = dataset , prefix = 'create' ) if dataset_form . is_valid ( ) : dataset_form . save ( ) response [ 'status' ] = 0 response [ 'data' ] = ( reverse ( 'oozie:edit_coordinator' , kwargs = { 'coordinator' : coordinator . id } ) + '#listDataset' ) request . info ( _ ( 'Dataset created' ) ) else : response [ 'data' ] = _ ( 'A POST request is required.' ) if ( response [ 'status' ] != 0 ) : response [ 'data' ] = render ( 'editor/create_coordinator_dataset.mako' , request , { 'coordinator' : coordinator , 'dataset_form' : dataset_form , 'dataset' : dataset } , force_template = True ) . content return JsonResponse ( response , safe = False )
returns {status 0/1 .