Skip to content

Commit dfbb2f2

Browse files
committed
Modify Publisher class to the top of file. Because Book class call Publisher class
1 parent 9a96590 commit dfbb2f2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

books/models.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
from django.db import models
22

33

4+
class Publisher(models.Model):
5+
name = models.CharField(max_length=50)
6+
address = models.CharField(max_length=100)
7+
website = models.URLField()
8+
9+
def __unicode__(self):
10+
return self.name
11+
12+
413
class Book(models.Model):
514
title = models.CharField(max_length=100)
615
authors = models.ManyToManyField('Author')
@@ -16,14 +25,5 @@ class Author(models.Model):
1625
name = models.CharField(max_length=50)
1726
email = models.EmailField()
1827

19-
def __unicode__(self):
20-
return self.name
21-
22-
23-
class Publisher(models.Model):
24-
name = models.CharField(max_length=50)
25-
address = models.CharField(max_length=100)
26-
website = models.URLField()
27-
2828
def __unicode__(self):
2929
return self.name

0 commit comments

Comments
 (0)