Add a LocalDataQuerySet for using generic data in WebAPIResource.
Review Request #5880 — Created May 26, 2014 and submitted — Latest diff uploaded
This introduces
LocalDataQuerySet
, which operates similarly to a
QuerySet
, but can store any iterable data. The interface it exposes is
similar enough toQuerySet
for basic usage.While this may be useful for various purposes, it's largely intended for
use withWebAPIResource
. Before now, gettingWebAPIResource
to return
data not from a database was tricky. You had to rewrite the
serialization functions,get()
,get_list()
, etc. Now,get_queryset()
can
return aLocalDataQuerySet
, passing in whatever it needs, and
WebAPIResource
will work with it.
Unit tests pass.
Used this with the new HostingServiceResource to great success.
Diff Revision 1
This is not the most recent revision of the diff. The latest diff is revision 3. See what's changed.
djblets/db/query.py |
---|
djblets/db/tests.py |
---|
djblets/webapi/resources.py |
---|