Commit dd80402129c031ef818f9e701c96252d6980f9f1
1 parent
a0469e6e
Exists in
master
and in
5 other branches
File model #127
Showing
1 changed file
with
14 additions
and
1 deletions
Show diff stats
courses/models.py
... | ... | @@ -2,7 +2,7 @@ from django.utils.translation import ugettext_lazy as _ |
2 | 2 | from django.db import models |
3 | 3 | from autoslug.fields import AutoSlugField |
4 | 4 | from users.models import User |
5 | -from core.models import Resource | |
5 | +from core.models import Resource, MymeType | |
6 | 6 | from s3direct.fields import S3DirectField |
7 | 7 | |
8 | 8 | class CourseCategory(models.Model): |
... | ... | @@ -116,6 +116,19 @@ class Material(Resource): |
116 | 116 | all_students = models.BooleanField(_('All Students'), default=False) |
117 | 117 | |
118 | 118 | """ |
119 | +Topic File | |
120 | +""" | |
121 | +class File(Material): | |
122 | + description = models.TextField(_('Description'), blank=True) | |
123 | + content = models.FileField(upload_to='uploads/courses/subject/topic/%Y/%m/%d/') | |
124 | + typ = models.ForeignKey(MymeType, verbose_name= _('Type'), related_name='file') | |
125 | + | |
126 | + class Meta: | |
127 | + verbose_name = _('Topic file') | |
128 | + verbose_name_plural = _('Topic files') | |
129 | + | |
130 | + | |
131 | +""" | |
119 | 132 | It is a category for each subject. |
120 | 133 | """ |
121 | 134 | class SubjectCategory(models.Model): | ... | ... |