diff --git a/imagehosting/models.py b/imagehosting/models.py index 7573700..d77a855 100644 --- a/imagehosting/models.py +++ b/imagehosting/models.py @@ -10,8 +10,8 @@ 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) - + orig_name = property(orig_name) + def publish(self): self.published_date = timezone.now() self.save() @@ -22,7 +22,7 @@ class Post(models.Model): def thumb_name(self): x = os.path.split(self.file.name)[-1] return '/thumb_' + x - + def orig_name(self): x = os.path.split(self.file.name)[-1] return x \ No newline at end of file