dahlia / sqlalchemy-imageattach

SQLAlchemy extension for attaching images to entities.
https://sqlalchemy-imageattach.readthedocs.io/
MIT License
116 stars 25 forks source link

How to set no photo #21

Closed peterlada closed 10 years ago

peterlada commented 10 years ago

As a user of sqlalchemy-imageattach I'd like to set the model's image to blank (like when there is no image) so that I can give my clients a web interface to delete the photo.

1 I'd like it to be gone from the association with the model (to a state identical to when the association not yet happened).

2 I'd like the physical image (original and thumbnails) all be deleted as well for security reasons. This can be optional.

Perhaps the feature is there, I'm just not finding the documentation?

dahlia commented 10 years ago

Although you maybe already aware of this:

image_attachmenet() function is a specialized relationship() for image entities. You can understand it as one-to-many relationship.

In the same fashion, ImageSet is also a subtype of Query. You can remove an already attached image using ImageSet.delete() method.

peterlada commented 10 years ago

Super. It's an utter and complete success!