I spent some time last night and today working on a demo link browsing
via the API. I've attached the patch required to see my demo as I just
wanted to get some thoughts on it.
The major change is a schema change to the Attachments object. I added
both type and subtype columns to give some kind of MIME type querying.
i.e. /attachments?type=image would give all image attachments and
/attachments?type=image&subtype=png would only give the PNG images.
My test sketch is included as the links.html and links.css files which
query for attachments of type links.
Should I commit this? I know Shane had mentioned the Attachment storage
was likely to change so I could wait on those changes.
Cheers,
~ Bryan
Great!
> Should I commit this? I know Shane had mentioned the Attachment storage
> was likely to change so I could wait on those changes.
I think you should - though please change the String() fields to have a
length for mysql's sake - ie:
+ type = Column(String) # mime type 'image' of image/jpeg
+ subtype = Column(String) # mime type 'jpeg' of image/jpeg
should be something like:
+ type = Column(String(50)) # mime type 'image' of image/jpeg
+ subtype = Column(String(50)) # mime type 'jpeg' of image/jpeg
Mark
http://127.0.0.1:5000/sketches/links.html
Cheers,
~ Bryan