-
Notifications
You must be signed in to change notification settings - Fork 2
/
models.py
68 lines (55 loc) · 2.25 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
"""
Definition of models.
"""
from django.db import models
# Create your models here.
#class users(models.Model):
#id = models.CharField(max_length=30).primary_key=True
#member_id = models.CharField(max_length=60)
#username = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#exp_date = models.CharField(max_length=60)
#admin_enabled = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
#password = models.CharField(max_length=60)
class SqlModel(models.Model):
q_id = models.IntegerField()
class University(models.Model):
name = models.CharField(max_length=50)
class Meta:
verbose_name = "University"
verbose_name_plural = "Universities"
def __unicode__(self):
return self.name
class Student(models.Model):
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
university = models.ForeignKey(University, on_delete=models.DO_NOTHING)
class Meta:
verbose_name = "Student"
verbose_name_plural = "Students"
def __unicode__(self):
return '%s %s' % (self.first_name, self.last_name)