Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Renaming file field.

  • Loading branch information...
commit 914b08667596ff585fb04db3615b2bc27a68aad5 1 parent 6f4f68c
@lukeman lukeman authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 mimesis/models.py
View
4 mimesis/models.py
@@ -15,7 +15,7 @@ class MediaUpload(models.Model):
title = models.CharField(max_length=150)
description = models.TextField()
- file = models.FileField(upload_to="mimesis")
+ media = models.FileField(upload_to="mimesis")
creator = models.ForeignKey(User)
created = models.DateTimeField(default=datetime.datetime.now)
media_type = models.CharField(editable=False, max_length=100)
@@ -31,7 +31,7 @@ def mime_type(self):
return "%s/%s" % (self.media_type, self.media_subtype)
def save(self, *args, **kwargs):
- (mime_type, encoding) = mimetypes.guess_type(self.file.path)
+ (mime_type, encoding) = mimetypes.guess_type(self.media.path)
try:
mime = mime_type.split("/")
self.media_type = mime[0]
Please sign in to comment.
Something went wrong with that request. Please try again.