heroku
This commit is contained in:
parent
596d9e0358
commit
34096bf8c3
@ -10,8 +10,8 @@ class Post(models.Model):
|
|||||||
name = models.CharField(max_length=30, blank=True)
|
name = models.CharField(max_length=30, blank=True)
|
||||||
file = models.FileField(upload_to='images')
|
file = models.FileField(upload_to='images')
|
||||||
thumb_name = property(thumb_name)
|
thumb_name = property(thumb_name)
|
||||||
orig_name = property(orig_name)
|
orig_name = property(orig_name)
|
||||||
|
|
||||||
def publish(self):
|
def publish(self):
|
||||||
self.published_date = timezone.now()
|
self.published_date = timezone.now()
|
||||||
self.save()
|
self.save()
|
||||||
@ -22,7 +22,7 @@ class Post(models.Model):
|
|||||||
def thumb_name(self):
|
def thumb_name(self):
|
||||||
x = os.path.split(self.file.name)[-1]
|
x = os.path.split(self.file.name)[-1]
|
||||||
return '/thumb_' + x
|
return '/thumb_' + x
|
||||||
|
|
||||||
def orig_name(self):
|
def orig_name(self):
|
||||||
x = os.path.split(self.file.name)[-1]
|
x = os.path.split(self.file.name)[-1]
|
||||||
return x
|
return x
|
Loading…
Reference in New Issue
Block a user