Example #1
0
class ordendetrabajo(models.Model):
    id_orden = models.AutoField(max_length=6, primary_key=True)
    id_cliente = models.ForeignKey(cliente, on_delete=models.CASCADE)
    run_cliente = models.ForeignKey(cliente, on_delete=models.CASCADE)
    nombre_cliente = models.ForeignKey(cliente, on_delete=models.CASCADE)
    fecha = model.DataField(null=False)
    hora_ini = models.DataField(null=False)
    hora_term = models.DataField(null=False)
    id_ascensor = models.AutoField(max_length=10, null=False)
    modelo_ascensor = model.CharField(max_length=20, null=False)
    descripcion_falla = modelsCharField(max_length=300, null=True)
    descripcion_reparacion = models.CharField(max_length=300, null=True)
    piezas_cambiadas = models.CharField(max_length=200, null=True)
    nombre_receptor = models.CharField(max_length=50, null=True)
    id_usuario = models.ForeignKey(usuario, on_delete=models.CASCADE)
Example #2
0
class Account(models.Model):
	user_name = models.CharField(max_length = 80)
	password = models.CharField(max_length = 255)
	reg_data = models.DataField()

	def __unicode__(self):
		return "Account: %s" %self.user_name
Example #3
0
class Usuarios(models.Model):

    PrimerApellido = models.CharField(max_length=35)
    SegundoApellido = models.CharField(max_length=35)
    Nombres = models.CharField(max_length=35)
    FechaNacimiento = models.DataField()
    Sexos = (('F')('Femenino')('M')('Masculino'))
    Sexo = models.CharField(max_length=1, choices='sexos', defaul='M')

    def nombreCompleto(self):
        cadena = "{0}, {1}, {2}"
        return cadena.format(self.PrimerApellido, self.SegundoApellido,
                             self.Nombres)

    def __str__(self):
        return self.nombreCompleto()

    class Noticia(models.Model):
        Titulo = models.charField(max_length=20)
        Direccion = models.charField(max_length=35)
        Especificacion = models.charField(max_length=35)
        FechadeInicio = models.DateTimeField(auto_now_add=False)

    class IngresaInfo(models.Model):
        Usuarios = models.ForeiKey(Usuarios,
                                   null=False,
                                   blank=False,
                                   on_delete=models.CASCADE)
        Noticia = models.ForeiKey(Noticia,
                                  null=False,
                                  blank=False,
                                  on_delete=models.CASCADE)
        FechaInfoEvento = models.DateTimeField(auto_now_add=True)
Example #4
0
class Teacher(models.Model):
    first_name = models.CharField(max_length=50)
    last_name = models.CharField(max_length=50)
    date_of_birth = models.DataField()
    registration_no = models.CharField(max_length=20)
    place_of_residence = models.CharField(max_length=50)
    phone_number = models.CharField(max_length=50)
    email = models.EmailField()
    id_number = models.IntegerField(max_length=8)
Example #5
0
  class Course(models.Model):

    name=models.CharField('Nome', max_length=100)
    slug=models.SlugField('Atalho')
    description=models.TextField('Descrição', blank=True)
    start_date=models.DataField('Data de Início', null=True, blank=True)
    image=models.ImageField( upload_to='courses/images', verbose_name='Image', null=True, blanck=True)
    created_at=models.DataTimeField('Criado em', auto_now_add=True)
    updated_at=models.DataTimeField('Atualizado em', auto_now=True)
Example #6
0
class Student(models.Model):
    first_name = models.CharField(max_length=50)
    last_name = models.CharField(max_length=50)
    date_of_birth = models.DataField(max_length=20)
    registration_no = models.CharField(max_length=15)
    place_of_residence = models.CharField(max_length=50)
    phone_number = models.CharField(max_length=50)
    email = models.EmailField(max_length=50)
    guardian_phone = models.CharField(max_length=50)
    id_number = models.IntegerField(max_length=8)
    date_joined = models.IntegerField(max_length=20)
Example #7
0
class Blogpost(models.Model):
    title = models.CharField(max_length=100, unique=True)
    author = models.CharField(max_length=100, unique=True)
    slug = models.SlugField(max_length=100, unique=True)
    body = models.TextField()
    posted = models.DataField(db_index=True, auto_now_add=True)

    def __unicode__(self):
        return '%s' %self.title

    @permalink
    def get_absolute_url(self):
        return ('view_blog_post', None, { 'slug': self.slug })
Example #8
0
class Contract(models.Model):
    '''合同'''
    sn = models.CharField('合同号', max_length=128, unique=True)
    name = models.CharField('合同名称', max_length=64)
    memo = models.TextField('备注', blank=True, null=True)
    price = models.IntegerField('合同金额')
    detail = models.TextField('合同详细', blank=True, null=True)
    start_day = models.DateField('开始日期', blank=True, null=True)
    end_day = models.DateField('失效日期', blank=True, null=True)
    license_num = models.IntegerField('license数量', blank=True, null=True)
    c_day = models.DateField('创建日期', auto_now_add=True)
    m_day = models.DataField('修改日期', auto_now=True)

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = '合同'
        verbose_name_plural = '合同'
Example #9
0
class AccessRecord(models.Model):
    name = models.ForeignKey(Webpage)
    date = models.DataField()

    def __str__(self):
        return str(self.date)
Example #10
0
class Student(models.Model):
    name = models.CharField(max_length=10)
    email = models.CharField()
    birthday = models.DataField()
    age = models.IntergerField()
Example #11
0
class Journal(models.Model):
    content = models.TextField("內容")
    created = models.DataField(auto_now_add=True)

    def __str__(self):
        return self.content
Example #12
0
class Blog(models.Model):
    author = models.ForeignKey(Owner, on_delete=models.CASCADE)
    heading = models.CharField(max_length=30, blank=False)
    date = models.DateField(auto_now_add=True)
    data = models.DataField(blank=True)
Example #13
0
 class Article(models.Model):
     pub_date = models.DataField()
     headline = models.TextField()
     reporter = models.ForeignKey(Reporter, on_delete=models.CASCADE)
     def __str__(self):
         return self.headline
Example #14
0
class Product(models.Model):
    Pid=models.IntegerField(primary_key=True)
    Pname=models.CharField(max_length=20)
    Pcost=models.DecimalField(max_digits=10,decimal_places=4)
    Pmfd=models.DataField()
    Pexpdt=models.DataField()
Example #15
0
class Session(models.Model):
	time_first = models.DataField() //начало сессии
	time_last = models.DataField() //конец сессии
	teacher = models.CharField(max_length = 30, choices = TEACHER_CHOICES)
	def unicod(self):
		return self.time_first + " " + self.time_last + " " + teacher