from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models

# Create your models here.
lst_sexo = ("M","masculino"),("F","femenino")
lst_estado = ("S","si"),("N","no")




class Inst_educativas(models.Model):
    nit = models.CharField(max_length=25)
    nombre = models.CharField(max_length=20)
    direccion = models.CharField(max_length=25)
    rector = models.ForeignKey('Usuario')
    class Meta:
        verbose_name = 'Institucion_educativa'
        verbose_name_plural = 'Inst_educativas'


    def def__Unicode__(self):
        return self.nombre

class Usuario(User):
    class Meta:
        proxy = True

class Grado(models.Model):
    grado = models.CharField(max_length=15)

class Sisben(models.Model)  :
    puntaje = models.CharField(max_length=15)

class Estrato(models.Model)  :
    estrato = models.CharField(max_length=15)

class Genero(models.Model)  :
    estrato = models.CharField(max_length=15)

class Persona(models.Model):
    nombres = models.CharField(max_length=50)
    apellidos = models.CharField(max_length=50)
    documento = models.CharField(max_length=12)
    email = models.EmailField(max_length=30)
    sexo = models.CharField(max_length=1, choices= lst_sexo)

class Estudiante(models.Model):
    nombres = models.CharField(max_length=50)
    apellidos = models.CharField(max_length=50)
    documento = models.CharField(max_length=12)
    carrera = models.CharField(max_length=50)
    genero = models.CharField(max_length=1, choices= lst_sexo)
    sisben = models.CharField(max_length=12)
    estrato = models.ForeignKey('Estrato',models.DO_NOTHING)
    direccion = models.CharField(max_length=60)
    contacto = models.CharField(max_length=12)
    nacimiento = models.CharField(max_length=12)
    email = models.EmailField(max_length=30)

class Alumno(models.Model):
    nombres = models.CharField(max_length=50)
    apellidos = models.CharField(max_length=50)
    documento = models.CharField(max_length=12)
    grado = models.ForeignKey('Grado',models.DO_NOTHING)
    genero = models.CharField(max_length=1, choices= lst_sexo)
    sisben = models.CharField(max_length=12)
    estrato = models.ForeignKey('Estrato',models.DO_NOTHING)
    transporte = models.CharField(max_length=1, choices= lst_estado)
    direccion = models.CharField(max_length=60)
    familias = models.CharField(max_length=1, choices= lst_estado)
    alimentacion = models.CharField(max_length=1, choices= lst_estado)
    desplazado = models.CharField(max_length=1, choices= lst_estado)
    contacto = models.CharField(max_length=12)
    nacimiento = models.CharField(max_length=12)
    email = models.EmailField(max_length=30)
    credo = models.CharField(max_length=25)

class docente(models.Model):
    nombres = models.CharField(max_length=50)
    apellidos = models.CharField(max_length=50)
    documento = models.CharField(max_length=12)
    email = models.EmailField(max_length=30)
    asignatura = models.CharField(max_length=50)
    contacto = models.CharField(max_length=12)