link browsing with the new API

0 views
Skip to first unread message

Bryan Clark

unread,
Jul 23, 2010, 6:56:51 PM7/23/10
to raindr...@googlegroups.com
Hey -

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

raindrop-links

Mark Hammond

unread,
Jul 23, 2010, 9:21:11 PM7/23/10
to raindr...@googlegroups.com, Bryan Clark
On 24/07/2010 8:56 AM, Bryan Clark wrote:
> Hey -
>
> 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.

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

Bryan Clark

unread,
Jul 25, 2010, 1:46:24 PM7/25/10
to Mark Hammond, raindr...@googlegroups.com
On 23/07/10 6:21 PM, Mark Hammond wrote:
> 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
Done! I pushed it already so you should be seeing a links page in
sketches/links.html

http://127.0.0.1:5000/sketches/links.html

Cheers,
~ Bryan

Reply all
Reply to author
Forward
0 new messages