-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemented general meeting slides on resources page
- Loading branch information
1 parent
c5d0e39
commit d888065
Showing
5 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
chrissprague
Author
Member
|
||
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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
don't check in broken code.