views:

14

answers:

1

I have a model that inherits from Photologues 'ImageModel'. The user can upload photos and everything works fine, however the problem I am running into is when I am creating a form to edit a photo object. Since the ImageModel.image is a required field, and I can't prepopulate a FileField widget with a file already uploaded, if the user doesn't upload a new image to overwrite the old one they get an error. The error pops up in form.save() which I am using to get the rest of the fields updated right. Is there some way I can hook in and try say "since I know I am just editing an image, I know one has already been uploaded, so don't worry if the form field is empty".

Any thoughts?

A: 

You have a couple options. One, you can modify the Photologue source to make that field optional. The other, and if it will work for you the one I'd recommend, is to check out my newer library django-imagekit: http://bitbucket.org/jdriscoll/django-imagekit/wiki/Home

ImageKit is basically JUST the ImageModel part of Photologue but it's much more flexible and easier to work with. ImageKit's ImageModel works on top of the models that you define so fields can be configured how ever you please.

jdriscoll
I am only using the ImageModel part of photologue anyways, for its dynamic resizing and whatnot. Is there a clear way to upgrade from photologue to imagekit? this was kind of absent from the documentation, but I will fiddle around with it soon.
Fred
I'm afraid not. They are very difference architecturally. If you have any questions feel free to contact me through the Photologue Google group.
jdriscoll