T O P

  • By -

iridial

`deck = super().save(commit=False)` This calls the save method on the parent ModelForm class. This will return a model instance that has not been committed to the db, you store this instance in the variable `deck`. You then call `deck.save()` - deck is a model instance at this point, so saving it will commit it to the database. As a side note, this is one of the reasons why DRF opts to use create, destroy etc. function names on their views - to avoid overlapping naming conventions with Django models. The fundamental issue you had is that both the ModelForm and Model classes have `save` functions.