class Lançamento(models.Models): conta = models.ForeingKey(Conta, on_delete=models.CASCADE) fatura = models.ForeingKey(Fatura, on_delete=models.CASCADE) valor = models.FloatField() descricao = models.CharField(max_length=300) categoria = models.CharField(max_length=50) data = models.DateField()
class Cartao(models.Models): tipo_cartao = ('D', 'Débito'), ('C', 'Crédito') tipo = models.CharField(max_length=1, choices=tipo_cartao) limite = models.FloatField() conta = models.ForeingKey(Conta, on_delete=models.CASCADE) data_encerramento_fatura = models.DateField() data_vencimento = models.DateField() bandeira = models.CharField(max_length=20) usuario = models.ForeingKey(Usuario, on_delete=models.CASCADE) numero = models.IntegerField()
class Commernt(TimeStamedModel): author = models.ForeingKey(user_model.User, null=True, on_delete=models.CASCADE, related_name='comment_author') posts = models.ForeingKey(Post, null=True, on_delete=models.CASCADE, related_name='comment_post') contents = models.TextField(blank=True)
class Conta(models.Models): tipo_conta = ('P', 'Poupança'), ('C', 'Corrente') nome = models.CharField(max_length=100) saldo = models.FloatField() tipo = models.CharField(max_length=1, choices=tipo_conta) instituicao = models.CharField(max_length=100) usuario = models.ForeingKey(Usuario, on_delete=models.CASCADE)
class Perfil(models.Model): nome = models.CharFIeld(max_length=30) usuario = models.(on_delete=models.CASCADE) contados = models.ForeingKey("self") def get_timeline(self): return Postagem.objects.filter(perfil=self)
class Event(models.Model): level = models.CharField(max_length=20) data = models.TextField() arquivado = models.BooleanField() date = models.DateField(auto_now=True) agent_id = models.ForeingKey(Agent, on_delete=models.CASCADE) user_id = models.ForeignKey(User, on_delete=models.CASCADE)
class Consulta(models.Model): nombre=models.CharField(max_Lenght=45) detalle=models.CharField(max_Lenght=512) numero=models.IntegerField() fecha=models.DateField() correo=models.EmailField(100) camion=models.CharField(max_Lenght=45) foto=models.FileField(upload_to='uploads/') usuario=models.ForeingKey(Usuario, on_delete=models.CASCADE)
class INTERPRETATION(models.Model): class Meta: pass description = None tier = None concerns = models.ManyToMany('MORPHOLOGY') concerns = models.ManyToMany('TOPOGRAPHY') = models.ForeingKey('GENE', on_delete=models.PROTECT)
class Planificacion(models.Model): idplanificacion = models.AutoField(primary_key=True) idUsuario = models.ForeignKey(Usuario, on_delete=CASCADE) idmascota = models.ForeingKey(Mascota, on_delete=CASCADE) planificacionfecha = models.DateField(default=None) planificaciondescripcion = models.CharField(max_length=150) def __str__(self): return '%s: %s %s %s %s' % (self.idplanificacion, self.idusuario, self.idmascota, self.planificacionfecha, self.planificaciondescripcion)
class Entry(models.Model): user = models.ForeingKey(User) pub_date = models.DateTimeField(default=now) title = models.charFild(max_length=200) slug = models.slugField() body = models.TextField() def __unicode__(self): return self.title def __unicode__(self): if not self.slug: self.slug = slugify(self.title)[:50] return super(Entre, self).save(*args, **kwargs)
class Libro(models.Model): """Model definition for Libro.""" categoria = models.ForeingKey(Categoria, on_delete = models.CASCADE) autores = models.ManyToManyField(Autor) titulo = models.CharField( max_length=50) fecha = models.DateField('Fecha de lanzamiento') portada = models.ImageField( upload_to='portada') visitas = models.PositiveIntegerField() class Meta: """Meta definition for Libro.""" verbose_name = 'Libro' verbose_name_plural = 'Libros' def __str__(self): """Unicode representation of Libro.""" return self.titulo
class Publication(models.Model): image = models.ImageField(upload_to="publication/") title = models.CharField(max_length=50, verbose_name="Título") description = models.TextField(max_length=300, verbose_name="Descripción corta") full_description = RichTextField(verbose_name="Descripción completa") create_date = models.DateField(verbose_name="Fecha de creación", auto_now_add=True) update_date = models.DateField(verbose_name="Fecha de actualización", auto_now=True) categories = models.ManyToManyField( PublicationCategory, verbose_name="Categorías de publicación") author = models.ForeingKey('auth.User', verbose_name="Tecnologías o herramientas", on_delete=models.PROTECT) def __str__(self): return '{}'.format(self.title) class Meta: verbose_name = 'Publicación' verbose_name_plural = 'Publicaciones'
class MyItem(models.Model): item = models.ForeignKey(Item, on_delete=models.CASCASDE) user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) isInFarm = models.ForeingKey() location = models.IntegerField()
from django.db import models from apps.vehiculo.models import Vehiculo from app.sistemaFreno.models import SistemaFreno # Create your models here. class Prueba(models.Model): velocidad_inicial = models.DecimalField( max_digits=5, decimal_places=2) tiempo_frenado = models.DecimalField( max_digits=5, decimal_places=2) distancia de frenado = models.DecimalField(max_digits=7, decimal_places=2) fuerzaPedal = models.DecimalField( max_digits=5, decimal_places=2) vehiculo = models.ForeingnKey(Vehiculo, null=True, blank=True, on_delete=models.CASCADE) sistemaFreno = models.ForeingKey(SistemaFreno, null=True, blank= True, on_delete=models.CASCADE)
class Choise(models.Model): choise_text = models.CharField(max_length=200) votes = models.IntegerField(default=0) question = models.ForeingKey(Question, on_delete=models.CASCADE)
class Reserva(models.Model): Fecha=DateField() Horario=CharField(max_lenght=30) cliente=models.ForeingKey(cliente,on_delete=models.CASCADE) Mesa=models.ForeingKey(Mesa,on_delete=models.CASCADE)
class Fatura(models.Models): cartao = models.ForeingKey(Cartao, on_delete=moldes.CASCADE) referencia = models.CharField(max_length=200) valor = models.FloatField()
PORTE = ( ('P', 'pequeno'), ('M', 'medio'), ('G', 'grande'), ) nome = models.CharField( max_length=225, verbose_name = 'nome', ) raca = models.CharField( max_length=225, verbose_name = 'raca', ) porte = models.CharField( max_length=225, verbose_name = 'porte', choices=PORTE ) peso = models.floatField( verbose_name = 'peso', ) dono = models.ForeingKey(Pessoa, on_delete=None ) criado_em = models.DateTimeField( auto_now_add=True ) ativo = models.BooleanField( default=True )
class Testimonio(models.Model): nombre=models.CharField(max_Lenght=45) correo=models.EmailField(max_Lenght=100) testimonio=models.CharField(max_Lenght=512) usuario=models.ForeingKey(Usuario, on_delete=models.CASCADE)
class Compromisso(models.Model): nome = models.CharField(max_length=150) dataI = models.DataTime() dataF = models.DataTime() agendas = models.ForeingKey(Agenda, related_name='agendas', blank=True)