Skip to content

Commit

Permalink
Use new style super()
Browse files Browse the repository at this point in the history
  • Loading branch information
macro1 committed Nov 5, 2014
1 parent a156238 commit 58f3643
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions myblog/blog/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ class Meta:

def __init__(self, *args, **kwargs):
self.entry = kwargs.pop('entry') # the blog entry instance
super(CommentForm, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)

def save(self):
comment = super(CommentForm, self).save(commit=False)
comment = super().save(commit=False)
comment.entry = self.entry
comment.save()
return comment
4 changes: 2 additions & 2 deletions tutorials/05-forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@ Okay now let's finally write our form code.
def __init__(self, *args, **kwargs):
self.entry = kwargs.pop('entry') # the blog entry instance
super(CommentForm, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
def save(self):
comment = super(CommentForm, self).save(commit=False)
comment = super().save(commit=False)
comment.entry = self.entry
comment.save()
return comment
Expand Down

0 comments on commit 58f3643

Please sign in to comment.