Django unexpected keyword argument 'instance' -
Hello I am crating a scene to edit the model using model forms.
My variations.py look like: user_profile. Moderate user_profile.modiles import project Import ModelForm def ProjectForm: Class Meta: Model = Project
and my thoughts .gi:. Import: django.shortcuts import from import from django.template import render_to_response from user_profile.models Import RequestContext from user_profile.forms Import from ProjectForm def EditProject (request, project_id = none): "" "This view allows a user to add a project Edit the project's project = project.objects.get (id = 4) if request.method == 'POST': form = Project.POST (Request.POST). If form.is_valid (): # form form.save () otherwise save: return render_to_response ('edit_project.html', {'title': title, 'form': form,}, RequestContext (requested)) I: Finding a I do not understand why, as you can see in the form of a model Can you give, can not you? Any support will be highly appreciated. when Not even this, while posting it is just a typo, your problem is that you have defined a project form function , not a class. project form () is an unexpected keyword argument 'example' : title, 'form': form,}, requestcontext (request) / code> error?
def project format:
Comments
Post a Comment