#18883 closed Bug (fixed)
self is missing
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Documentation | Version: | 1.4 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
paragraph: Model instance reference -> Creating objects -> Note -> 2:
class BookManager(models.Manager):
def create_book(title):
book = self.create(title=title)
# do something with the book
return book
correct:
class BookManager(models.Manager):
def create_book(self, title):
book = self.create(title=title)
# do something with the book
return book
Note:
See TracTickets
for help on using tickets.
In [17d57275f991f001fbdbf4a85159244096f43499]: