From e1bc2424779524442e91b0437c8d44c5c493b27d Mon Sep 17 00:00:00 2001 From: Anna Date: Tue, 12 Dec 2017 13:22:26 +0300 Subject: [PATCH] heroku --- imagehosting/models.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/imagehosting/models.py b/imagehosting/models.py index d77a855..126639c 100644 --- a/imagehosting/models.py +++ b/imagehosting/models.py @@ -9,8 +9,8 @@ import os class Post(models.Model): name = models.CharField(max_length=30, blank=True) file = models.FileField(upload_to='images') - thumb_name = property(thumb_name) - orig_name = property(orig_name) + + def publish(self): self.published_date = timezone.now() @@ -23,6 +23,10 @@ class Post(models.Model): x = os.path.split(self.file.name)[-1] return '/thumb_' + x + thumb_name = property(thumb_name) + def orig_name(self): x = os.path.split(self.file.name)[-1] - return x \ No newline at end of file + return x + + orig_name = property(orig_name)