I've started creating a photo blog project to get familiar with Python
and Django. I'm using Python 2.6.1 and Django 1.0.2. I'm working on
the models and the administration first, before I tackle the front end
side of the site. I have everything working fine, for the exception of
an image upload field in the administration.

I assume I'm just going to have to add an "ImageField" in the model.
That I get, however, every time a new image is uploaded I want to
resize and save a few copies of the images for thumbnail use, and I
don't know how to go about extending an administration form like that.

I've been looking around and I've seen the save method in the model
class. For example I'm using this to come up with the post title slug:

    def save(self):
        self.name_slug = re.sub('[^a-zA-Z0-9]', '_', self.name).strip
('_').lower()
        self.name_slug = re.sub('[-]+', '_', self.name_slug)
        super(Entry, self).save()

Should I add the image manipulation code in the save method? What is
the best way to go about this issue?

On another note, is there a good resource for image manipulation in
Python?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to