Wednesday, November 27, 2019

Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

I didn't have one.  I thought UpdateView would create the form for me.  But I was working the problem and made one:
from django.forms import ModelForm
from . models import Circuitinfotable

class CircuitinfotableForm(ModelForm):
    class Meta:
        model = Circuitinfotable
        fields = '__all__'


So I also changed my view:
class editLit(UpdateView):
    pk_url_kwarg = 'circuitid'
    model=Circuitinfotable
    form_class= CircuitinfotableForm
    template="/viewLit/editCircuit.html"
#    fields='__all__'




--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cdbc9127-6a2f-4022-bbda-dfec83101834%40googlegroups.com.

No comments:

Post a Comment