from django.db import models
from django.contrib.auth.models import User
from django.db.models.fields import files
# Create your models here.

class Counter(models.Model):
    Counter = models.ForeignKey(User, to_field="username", on_delete=models.CASCADE)
    Counter_Title = models.CharField(max_length=50)
    Counter_Duty = models.CharField(max_length=100)
    Counter_Theme = models.CharField(max_length=20)
    Counter_Reply_Time = models.IntegerField()
    def __str__(self):
        return "%s" % (self.Counter_Title)

    
class Query(models.Model):
    query = models.TextField()
    DOC = models.DateTimeField()
    Counter = models.ForeignKey(User,on_delete=models.CASCADE,null=False)


class Form(models.Model):
    #Form_ID = models.AutoField(primary_key=True)
    Creator = models.ForeignKey(Counter,on_delete=models.CASCADE,null=False)
    Name = models.CharField(max_length=50)
    DOC = models.DateTimeField()
    htmlForm = models.TextField()
    LastEdit = models.DateTimeField()
    Background = models.ImageField(upload_to="ServerApp/static/images")
    inputs = models.IntegerField()

class Request(models.Model):
    Student_Name = models.CharField(max_length=100)
    Dept = models.CharField(max_length=30)
    Current_Year = models.CharField(max_length=30)
    Admission_Year = models.CharField(max_length=30)
    Subject = models.CharField(max_length=100)
    Request = models.TextField()
    files = models.TextField()
    DOA = models.DateTimeField()
    Status = models.CharField(max_length=20)
    token = models.CharField(max_length=30,unique=True)
