Created
June 20, 2016 20:36
-
-
Save fchevitarese/bbf6135007635f679616c07ea1a925e5 to your computer and use it in GitHub Desktop.
modelo.py
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
class Esporte(models.Model): | |
"""(Esporte description)""" | |
nome = models.CharField(blank=True, max_length=100) | |
sexo = models.CharField(blank=True, max_length=1, choices=['M', 'F']) | |
idade = models.IntegerField() | |
def __unicode__(self): | |
return u"Esporte" | |
class Pessoa(models.Model): | |
"""(Pessoa description)""" | |
sexo = models.CharField(blank=True, max_length=1, choices=['M', 'F']) | |
idade = models.IntegerField() | |
def __unicode__(self): | |
return u"Pessoa" | |
class EsportePessoa(models.Model): | |
"""(EsportePessoa description)""" | |
pessoa = models.ForeignKey('Pessoa') | |
esporte = models.ForeignKey('Esporte') | |
def __unicode__(self): | |
return u"EsportePessoa" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment