from django.db import models
from django.utils import timezone

# Course Category
class Course_category(models.Model):
    category_id = models.AutoField(primary_key=True)
    category_name = models.CharField(max_length=100)
    date_of_creation = models.DateTimeField(default=timezone.now)
 
# Course Subcategory
class Course_subcategory(models.Model):
    subcategory_id = models.AutoField(primary_key=True)
    category = models.ForeignKey(Course_category, on_delete=models.CASCADE)
    subcategory_name = models.CharField(max_length=100)
    date_of_creation = models.DateTimeField(default=timezone.now)

# Course
class Course(models.Model):
    course_id = models.AutoField(primary_key=True)
    subcategory = models.ForeignKey(Course_subcategory, on_delete=models.CASCADE)
    subcategory_name = models.CharField(max_length=100)
    category_name = models.CharField(max_length=100)
    course_name = models.CharField(max_length=100)
    date_of_creation = models.DateTimeField(default=timezone.now)
    course_description = models.TextField(default="")
    course_difficulty = models.CharField(max_length=30)

# Course resources
class Course_resource(models.Model):
    course = models.ForeignKey(Course, on_delete=models.CASCADE)
    resourse_content = models.TextField(default="NIL")
    resourse_name = models.CharField(max_length=100)
    resourse_link = models.CharField(max_length=200)
    resourse_length = models.CharField(max_length=10)
    date_of_creation = models.DateTimeField(default=timezone.now)

[((137, 171), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)'}), '(primary_key=True)\n', (153, 171), False, 'from django.db import models\n'), ((192, 224), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (208, 224), False, 'from django.db import models\n'), ((248, 290), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'default': 'timezone.now'}), '(default=timezone.now)\n', (268, 290), False, 'from django.db import models\n'), ((375, 409), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)'}), '(primary_key=True)\n', (391, 409), False, 'from django.db import models\n'), ((425, 485), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Course_category'], {'on_delete': 'models.CASCADE'}), '(Course_category, on_delete=models.CASCADE)\n', (442, 485), False, 'from django.db import models\n'), ((509, 541), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (525, 541), False, 'from django.db import models\n'), ((565, 607), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'default': 'timezone.now'}), '(default=timezone.now)\n', (585, 607), False, 'from django.db import models\n'), ((662, 696), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)'}), '(primary_key=True)\n', (678, 696), False, 'from django.db import models\n'), ((715, 778), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Course_subcategory'], {'on_delete': 'models.CASCADE'}), '(Course_subcategory, on_delete=models.CASCADE)\n', (732, 778), False, 'from django.db import models\n'), ((802, 834), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (818, 834), False, 'from django.db import models\n'), ((855, 887), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (871, 887), False, 'from django.db import models\n'), ((906, 938), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (922, 938), False, 'from django.db import models\n'), ((962, 1004), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'default': 'timezone.now'}), '(default=timezone.now)\n', (982, 1004), False, 'from django.db import models\n'), ((1030, 1058), 'django.db.models.TextField', 'models.TextField', ([], {'default': '""""""'}), "(default='')\n", (1046, 1058), False, 'from django.db import models\n'), ((1083, 1114), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(30)'}), '(max_length=30)\n', (1099, 1114), False, 'from django.db import models\n'), ((1185, 1236), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Course'], {'on_delete': 'models.CASCADE'}), '(Course, on_delete=models.CASCADE)\n', (1202, 1236), False, 'from django.db import models\n'), ((1260, 1291), 'django.db.models.TextField', 'models.TextField', ([], {'default': '"""NIL"""'}), "(default='NIL')\n", (1276, 1291), False, 'from django.db import models\n'), ((1312, 1344), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (1328, 1344), False, 'from django.db import models\n'), ((1365, 1397), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (1381, 1397), False, 'from django.db import models\n'), ((1420, 1451), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(10)'}), '(max_length=10)\n', (1436, 1451), False, 'from django.db import models\n'), ((1475, 1517), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'default': 'timezone.now'}), '(default=timezone.now)\n', (1495, 1517), False, 'from django.db import models\n')]