Last active
October 5, 2017 20:16
-
-
Save JeffersonCarvalh0/8ed4ccb7af278a32e66a81f5ac6a20c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
from django.db import models | |
# Create your models here. | |
class Publisher(models.Model): | |
''' | |
Publisher (Editora) | |
''' | |
name = models.CharField(max_length=30) | |
address = models.CharField(max_length = 50) | |
city = models.CharField(max_length = 60) | |
state_province = models.CharField(max_length = 30) | |
country = models.CharField(max_length = 50) | |
website = models.URLField() | |
class Author(models.Model): | |
''' | |
Author (Autor) | |
''' | |
first_name = models.CharField(max_length = 30) | |
last_name = models.CharField(max_length = 40) | |
email = models.EmailField() | |
class Book(models.Model): | |
''' | |
Book (Livro) | |
''' | |
title = models.CharField(max_length = 100) | |
authors = models.ManyToManyField(Author) | |
publisher = models.ForeignKey(Publisher) | |
publication_date = models.DateField() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment