(request, uid)
return render(request, 'data_edit.html', context)
Edit meta-data associated with Data.
Edit meta-data associated with Data.
Edit meta - data associated with Data .
def data_edit(request, uid):
    """
    Edit meta-data associated with Data.
    """
    data = Data.objects.filter(uid=uid).first()
    form = forms.DataEditForm(instance=data, initial=dict(type=data.type), user=request.user)

    if request.method == "POST":
        form = forms.DataEditForm(data=request.POST, instance=data, user=request.user, files=request.FILES)
        if form.is_valid():
            form.save()
            return redirect(reverse("data_view", kwargs=dict(uid=data.uid)))

    context = dict(data=data, form=form, activate='Edit Data', project=data.project)

    context.update(get_counts(data.project))
    return render(request, 'data_edit.html', context)
def data_edit ( request , uid ) : data = Data . objects . filter ( uid = uid ) . first ( ) form = forms . DataEditForm ( instance = data , initial = dict ( type = data . type ) , user = request . user ) if request . method == "POST" : form = forms . DataEditForm ( data = request . POST , instance = data , user = request . user , files = request . FILES ) if form . is_valid ( ) : form . save ( ) return redirect ( reverse ( "data_view" , kwargs = dict ( uid = data . uid ) ) ) context = dict ( data = data , form = form , activate = 'Edit Data' , project = data . project ) context . update ( get_counts ( data . project ) ) return render ( request , 'data_edit.html' , context )