Add a LocalDataQuerySet for using generic data in WebAPIResource.
Review Request #5880 — Created May 26, 2014 and submitted
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.
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: djblets/db/query.py djblets/webapi/resources.py djblets/db/tests.py Ignored Files:
- Change Summary:
-
Fixed some text that didn't get changed when I renamed the class.
- Commit:
-
31e4ca9661777274e45b08953dfb2d9178f0565e6a6b1df39c01b24fb1d6a6be486662e8b5016a3b
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: djblets/db/query.py djblets/webapi/resources.py djblets/db/tests.py Ignored Files:
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: djblets/db/query.py djblets/webapi/resources.py djblets/db/tests.py Ignored Files:
- Change Summary:
-
Fixed the typo.
- Commit:
-
6a6b1df39c01b24fb1d6a6be486662e8b5016a3b6a17cacff129b1e44796277f9ae283774b0e25ba
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: djblets/db/query.py djblets/webapi/resources.py djblets/db/tests.py Ignored Files: