models.py 584 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
from django.db import models
from django.conf import settings
from model_utils.models import TimeStampedModel
from django.core.validators import RegexValidator

# Create your models here.
class Course(TimeStampedModel):
	name = models.CharField(max_length=255)
	department = models.CharField(max_length=255)
10
11
12
        departmentAbbreviation = models.CharField(max_length=4)
	#number = models.CharField(max_length=255, validators=RegexValidator('[0-9]{3,}'))
	number = models.CharField(max_length=3)
13
14

	def __unicode__(self):
15
		return "%s:%s  %s", self.department, self.number, self.name