[Sugar-devel] chooser/datastore documentation
walter.bender at gmail.com
Fri Oct 8 05:28:33 EDT 2010
On Fri, Oct 8, 2010 at 4:48 AM, Sascha Silbe
<sascha-ml-reply-to-2010-3 at silbe.org> wrote:
> Excerpts from Walter Bender's message of Fri Oct 08 01:45:21 +0200 2010:
>> I am struggling with getting my activities to behave in consistent
>> ways when using the chooser and datastore.find() between Sugar 0.84
>> and more recent Sugar versions. (For example, I cannot get find() to
>> process mime-type query in 0.84 but it will handle a title query.
> You can see the full list in src/carquinyol/indexstore.py (0.90 ,
> 0.88 , 0.86 , 0.84 ) resp. src/olpc/datastore/model.py for
> 0.82 .
> 0.90 (see _QUERY_TERM_MAP and _QUERY_VALUE_MAP):
> uid, activity, activity_id, mime_type, keep, timestamp, filesize,
> 0.86-0.88 (see _QUERY_TERM_MAP and _QUERY_VALUE_MAP):
> uid, activity, activity_id, mime_type, keep, timestamp
> 0.84 (see _parse_query):
> uid, activity, activity_id, mime_type (list), keep, timestamp (start/end
> 0.82 (see defaultModel):
> activity, activity_id, mime_type, keep, timestamp, title and a whole
> bunch more
> So mime_type should work fine in 0.84+ if you pass it as a list.
> sugar-datastore 0.86+ is more flexible regarding the contents of the
> query dictionary, so what works there does not necessarily work in 0.84.
> In particular 0.86+ will do what you expect if you pass a (single) MIME
> type as a regular string, but 0.84 requires you to pass a list (containing
> a single regular string). Because a string is iterable, 0.84 won't
> notice you didn't pass a list and will happily match each individual
> character against the MIME type field.
>> The exact opposite seems to be true in 0.90.
> AFAICT searching (!= sorting) title was never supported for 0.84+.
>> Similarly, I cannot get what_filter to work with non-GENERIC mime types,
> Yes, I recently filed a ticket about that .
>> I've searched unsuccessfully for documentation on what works in which
>> versions. Does such documentation exist somewhere?
> Maybe Bert has documented some of it in the wiki. It would be great if
> you could either augment his documentation or create a new one based on
> the information above.
Thanks. I'll write a test program to confirm all of the above and put
the results in the wiki.
>  http://git.sugarlabs.org/projects/sugar-datastore/repos/mainline/blobs/master/src/carquinyol/indexstore.py
>  http://git.sugarlabs.org/projects/sugar-datastore/repos/mainline/blobs/sucrose-0.88/src/carquinyol/indexstore.py
>  http://git.sugarlabs.org/projects/sugar-datastore/repos/mainline/blobs/sucrose-0.86/src/carquinyol/indexstore.py
>  http://git.sugarlabs.org/projects/sugar-datastore/repos/mainline/blobs/sucrose-0.84/src/carquinyol/indexstore.py
>  http://git.sugarlabs.org/projects/sugar-datastore/repos/mainline/blobs/sucrose-0.82/src/olpc/datastore/model.py
>  https://bugs.sugarlabs.org/ticket/2400
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
More information about the Sugar-devel