Commit f1e1b1d3cf1077775a7565d4f855f6a4a3ee9fde
1 parent
4924a536
Exists in
master
and in
3 other branches
created subject form
Showing
7 changed files
with
54 additions
and
0 deletions
Show diff stats
| @@ -0,0 +1,40 @@ | @@ -0,0 +1,40 @@ | ||
| 1 | +from django.db import models | ||
| 2 | + | ||
| 3 | +from autoslug.fields import AutoSlugField | ||
| 4 | + | ||
| 5 | +from django.utils.translation import ugettext_lazy as _ | ||
| 6 | + | ||
| 7 | +from users.models import User | ||
| 8 | + | ||
| 9 | +from categories.models import Category | ||
| 10 | + | ||
| 11 | +class Subject(models.Model): | ||
| 12 | + | ||
| 13 | + name = models.CharField( _("Name"), unique = True,max_length= 200) | ||
| 14 | + slug = AutoSlugField(_("Slug"),populate_from='name',unique=True) | ||
| 15 | + | ||
| 16 | + description_brief = models.CharField(_("simpler_description"), max_length= 100) | ||
| 17 | + description = models.CharField(_("description"), max_length = 300) | ||
| 18 | + visible = models.BooleanField(_("visible")) | ||
| 19 | + | ||
| 20 | + init_date = models.DateField(_('Begin of Subject Date')) | ||
| 21 | + end_date = models.DateField(_('End of Subject Date')) | ||
| 22 | + | ||
| 23 | + create_date = models.DateTimeField(_('Creation Date'), auto_now_add = True) | ||
| 24 | + update_date = models.DateTimeField(_('Date of last update'), auto_now=True) | ||
| 25 | + | ||
| 26 | + professor = models.ForeignKey(User, related_name="professor") | ||
| 27 | + students = models.ManyToManyField(User,verbose_name=_('Students'), related_name='subject_student', blank = True) | ||
| 28 | + | ||
| 29 | + category = models.ForeignKey(Category, related_name="subject_category") | ||
| 30 | + | ||
| 31 | + max_upload_size = models.IntegerField(_("Maximum upload size")) | ||
| 32 | + class Meta: | ||
| 33 | + verbose_name = "Subject" | ||
| 34 | + verbose_name_plural = "Subjects" | ||
| 35 | + | ||
| 36 | + def __str__(self): | ||
| 37 | + pass | ||
| 38 | + | ||
| 39 | + | ||
| 40 | +class Marker(models.Model): |