Advertisement
nefegago

models.py

Apr 21st, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.42 KB | None | 0 0
  1. from django.db import models
  2. from django.conf import settings
  3. from apps.ubicacion.models import Ciudad
  4. from .models import *
  5.  
  6.  
  7.  
  8. class Cliente(models.Model):
  9.     estado = models.BooleanField(default=True)
  10.     nombre_o_razon  = models.CharField(max_length=50)
  11.     apellido = models.CharField(max_length=50, null=True , blank=True)
  12.     direccion = models.CharField(max_length=50, null=True,blank=True)
  13.     tipo_identificacion = models.ForeignKey(TipoIdentificacion,on_delete=models.SET_NULL, null=True)
  14.     identificacion = models.CharField(max_length=50)
  15.     telefono = models.CharField(max_length=20)
  16.     email = models.EmailField()
  17.     nombre_contacto = models.CharField(max_length=50, null=True,blank=True)
  18.     ciudad = models.ForeignKey(Ciudad, on_delete=models.SET_NULL, null=True)
  19.     tipo_sociedad = models.ForeignKey(TipoSociedad, on_delete=models.SET_NULL,null=True, blank=True)
  20.     tipo_organizacion = models.ForeignKey(TipoOrganizacion, on_delete=models.SET_NULL,null=True)
  21.     regimenfiscal = models.ForeignKey(RegimenFiscal, on_delete=models.SET_NULL,null=True, blank=True)
  22.    
  23.     usuario = models.ManyToManyField(settings.AUTH_USER_MODEL, null=True, blank=True)
  24.     logo = models.ImageField(upload_to = 'imagen-cliente/', null=False)
  25.     fecha_creacion = models.DateTimeField(auto_now_add=True)
  26.     fecha_actualizacion = models.DateTimeField(auto_now=True)
  27.  
  28.     def __str__(self):
  29.         return self.nombre_o_razon
  30.  
  31.     class Meta():
  32.         verbose_name_plural = "Clientes"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement