I have created a ModelForm class to be able to create and edit database entries. Creating new entries works well, however, i dont know how to use ModelForms to edit/update a
Remember you still need to use the instance
parameter when you instantiate on POST.
instance = MyModel.objects.get(whatever)
if request.method == "POST":
form = MyModelForm(request.POST, instance=instance)
...
else:
form = MyModelForm(instance=instance)
Also possible and slightly shorter:
instance = MyModel.objects.get(whatever)
form = MyModelForm(request.POST or None, instance=instance)
...