If I have a model form and save it like:
f = FormModel(request.POST)
if f.is_valid():
f.save()
How can I get back that object that has
@Fabian, that's for editing an instance that wasn't previously included in your model form,
E.g your model form covers name, age, gender but in your model there is another field maybe country and you want to add it by yourself not your user, so you reveal the required fields and then you use the above procedure to add the rest This worked for me on the above prob
If form.is_valid()
Current_form=form.save()
My_new_id=Curret_form.id
This printed the id of the newly created objected which I later saved in another model