Closed mikeywaites closed 7 years ago
ImageSet
is designed to have different sizes of the same image (for example, thumbnails for various DPIs). In order to make Event
can have multiple EventAttachment
s you should have a more association table between them if we keep the current design of ImageSet
.
This should be fixable in sqlalchemy_imageattach
by changing the database structure so that instead of having
Thing --<--+--<--Image(original=True)
|
+--<--Image
|
+--<--Image
|
+--<--Image
We have:
Thing --<--+--<--Image(id=1234, original_id = NULL)
| |
^ ^
| |
| +--<--+--Image(original_id = 1234)
+-----|-----+
| |
| +--<--+--Image(original_id = 1234)
+-----|-----+
| |
| +--<--+--Image(original_id = 1234)
+-----------+
Ie, derived images reference both their original image and the thing in question
Multiple image sets have been supported since SQLAlchemy-ImageAttach 1.0.0 (which was released about a year ago), therefore I close this issue.
Lets say I have a Model
Event
. AnEvent
can have N attachments represented byEventAttachment
model. All the logic seems to be suited to the one case where there is a FK fromEvent
to the file attachment stored onEventAttachment
. Obviously i could manage this manually but it seems all the logic for saving and working with files is wrapped up in the ImageSet query class. Am i missing something here?Ideally i want to have N EventAttchement instances with the logic found in the ImageSet class. Ie i can save multiple EventAttachments each with a file directly by doing something like
Thanks.