melinath / django-daguerre

On-the-fly image manipulation for Django.
http://django-daguerre.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
85 stars 15 forks source link

Add admin widget for handling an image field's associated Areas. #34

Closed melinath closed 11 years ago

melinath commented 11 years ago

Right now, there is no way to edit Areas in the admin. There used to be, long ago, but it was removed at some point. Now that Areas are attached directly to storage paths, we need to have a widget for ImageFields that lets people edit the areas in the admin. Otherwise we might as well not have Areas, which would be ridiculous.

melinath commented 11 years ago

Still missing tests, docs, and (potentially) a "show all areas" button - but everything else is there. You can drop this in for any ModelAdmin:

from daguerre.widgets import AreaWidget

class MyModelAdmin(admin.ModelAdmin):
    formfield_overrides = {
        models.ImageField: {'widget': AreaWidget},
    }

Any time that you're not editing an area, you can create a new Area just by dragging it onto the image.

harrislapiroff commented 11 years ago

People are probably going to click on "Save" on their models before clicking "Save" on the area editor. We should make sure any area they're editing gets saved when that happens.