moodleNotifer

models.py
1 from django.db import models
2
3 # Create your models here.
4
5
8 class Student(models.Model):
9 TYPE_CHOICES = (
10 ("updater", "updater"),
11 ("General", "General"),
12 )
13
14 fname = models.CharField(max_length=200)
15 phone_number = models.CharField(max_length=10, unique=True)
16 roll_number = models.CharField(max_length=9, default="", unique=True)
17 moodle_token = models.CharField(max_length=50, default="", unique=True)
18 courses = models.CharField(max_length=50, default="")
19 user_type = models.CharField(max_length=10,choices=TYPE_CHOICES, default="General")
20 is_update = models.BooleanField(default=False)
21 update_courses = models.CharField(max_length=30, default="")
22
23 def __str__(self):
24 return "%s %s %s %s %s %s %s %s" % (self.fnamefname, self.phone_numberphone_number, self.roll_numberroll_number, self.moodle_tokenmoodle_token, self.coursescourses,
25 self.user_typeuser_type, self.is_updateis_update, self.update_coursesupdate_courses)
26
27 class Meta:
28 db_table = "student"
main.models.Student.Meta
Definition: models.py:27
main.models.Student
This Class is used for the Database Table: Student.
Definition: models.py:8
main.models.Student.user_type
user_type
Definition: models.py:19
main.models.Student.moodle_token
moodle_token
Definition: models.py:17
main.models.Student.fname
fname
Definition: models.py:14
main.models.Student.roll_number
roll_number
Definition: models.py:16
main.models.Student.update_courses
update_courses
Definition: models.py:21
main.models.Student.courses
courses
Definition: models.py:18
main.models.Student.phone_number
phone_number
Definition: models.py:15
main.models.Student.is_update
is_update
Definition: models.py:20