Re: newbie and slugs

2008-11-05 Thread Carmelly
Yes, you need to create the slug in your save() method. Something like: class Review(models.Model): ... def save(self): # add slug if there isn't one already if not self.slug: from django.template.defaultfilters import slugify self.slug = slugify(self.title

Aborting streaming uploads using UploadFileExceptions

2008-11-10 Thread Carmelly
The idea is, I would like to detect and abort an upload where the file size is over a certain limit, or if it's not a video file. Now with streaming uploads, this should be possible. I've written an upload handler: class UploadValidationHandler(FileUploadHandler): def handle_raw_input(self,

Changing an ImageField file without re-upload

2009-02-16 Thread Carmelly
My situation is this: I want to allow my users to upload multiple userpics and then choose between them. So I have a Profile model with an ImageField for the userpic. When users upload a file it is displayed around the site as usual. When they upload a new file, that file replaces their the "userp