Created
June 23, 2010 22:16
-
-
Save codekoala/450642 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import uuid | |
| from django.db import models | |
| from django.contrib.auth.models import User | |
| from cumulus.storage import CloudFilesStorage | |
| cloudfiles_storage = CloudFilesStorage() | |
| # Create your models here. | |
| class Upload(models.Model): | |
| id = models.CharField(primary_key=True, default=lambda: uuid.uuid4().hex[:10]) | |
| file = models.FileField(storage=cloudfiles_storage, upload_to='files') | |
| description = models.CharField(blank=True, null=True, max_length=255) | |
| date_added = models.DateTimeField(auto_now_add=True) | |
| added_by = models.ForeignKey(User) | |
| is_active = models.BooleanField(default=True) | |
| def __unicode__(self): | |
| return self.description |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment