Skip to content

Instantly share code, notes, and snippets.

@sivabudh
Created May 12, 2016 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sivabudh/9f0296816e7df487eb4c672afac13965 to your computer and use it in GitHub Desktop.
Save sivabudh/9f0296816e7df487eb4c672afac13965 to your computer and use it in GitHub Desktop.
class FranchiseUpdateView(viewsmixins.UpdateViewMixins):
model = Franchise
template_name = "franchise_update.html"
success_url = reverse_lazy('franchises:list')
form_class = FranchiseForm
form_prefix = "franchise"
# set prefix to parent form
def get_form_kwargs(self):
kwargs = super(FranchiseUpdateView, self).get_form_kwargs()
if self.form_prefix:
kwargs.update({'prefix': self.form_prefix})
return kwargs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment