MCPcopy
hub / github.com/django/django / Book

Class Book

tests/multiple_database/models.py:49–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48
49class Book(models.Model):
50 title = models.CharField(max_length=100)
51 published = models.DateField()
52 authors = models.ManyToManyField(Person)
53 editor = models.ForeignKey(
54 Person, models.SET_NULL, null=True, related_name="edited"
55 )
56 reviews = GenericRelation(Review)
57 pages = models.IntegerField(default=100)
58
59 objects = BookManager()
60
61 class Meta:
62 ordering = ("title",)
63
64 def __str__(self):
65 return self.title
66
67
68class Pet(models.Model):

Calls 2

GenericRelationClass · 0.90
BookManagerClass · 0.85

Tested by 5

test_default_creationMethod · 0.56
test_other_creationMethod · 0.56
test_refreshMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…