diff --git a/csc_new/pages/admin.py b/csc_new/pages/admin.py index 80401b3..a39922b 100755 --- a/csc_new/pages/admin.py +++ b/csc_new/pages/admin.py @@ -1,6 +1,7 @@ from django.contrib import admin -from pages.models import ExamReview, Photo +from pages.models import ExamReview, Photo, GeneralMeetingSlides # Register your models here. admin.site.register(ExamReview) admin.site.register(Photo) +admin.site.register(GeneralMeetingSlides) diff --git a/csc_new/pages/models.py b/csc_new/pages/models.py index a5542ab..4489081 100755 --- a/csc_new/pages/models.py +++ b/csc_new/pages/models.py @@ -27,6 +27,23 @@ def delete(self, *args, **kwargs): super(ExamReview, self).delete(*args, **kwargs) +class GeneralMeetingSlides(models.Model): + date = models.DateField() + pdf = models.FileField(upload_to="general_meeting_slides", verbose_name="PDF") + + class Meta: + verbose_name = "General Meeting Slides" + verbose_name_plural = verbose_name + + def __str__(self): + return self.date.__str__() + + def delete(self, *args, **kwargs): + # this is broken (the delete doesn't work; the file lingers in MEDIA_ROOT) + os.remove(os.path.join(settings.MEDIA_ROOT, str(self.pdf))) + super(GeneralMeetingSlides, self).delete(*args, **kwargs) + + class Photo(models.Model): title = models.CharField(max_length=100) desc = models.CharField(max_length=255) diff --git a/csc_new/pages/templates/pages/resources.html b/csc_new/pages/templates/pages/resources.html index 5357406..64d90f0 100755 --- a/csc_new/pages/templates/pages/resources.html +++ b/csc_new/pages/templates/pages/resources.html @@ -46,6 +46,17 @@