Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.db import models
- # Create your models here.
- class Agricultura(models.Model):
- producto = models.CharField('Producto', max_length=50)
- temporada = models.CharField('Temporada', max_length=50)
- habitat = models.CharField('Habitat', max_length=50)
- created = models.DateTimeField('Creado', auto_now_add=True)
- class Meta:
- ordering = ['created']
- class Productores(models.Model):
- nombre = models.CharField('Nombre', max_length=50)
- apellido = models.CharField('Apellido', max_length=50)
- apellido2 = models.CharField('Apellido 2', max_length=50)
- direccion = models.CharField('Direccion', max_length=50)
- produce = models.ForeignKey(Agricultura, related_name='productores', on_delete=models.CASCADE)
- def __str__(self):
- return self.nombre
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement