Juergen Brendel 04089533ef Use DB count to get resource counts.
Fixes bug 1075369.

During quota check we used to simply retrieve the entire collection
of resources from the database, then counting them in Python. This
patch introduces a specialized _get_collection_count() method, which
instead take advantage of the DB's built-in count capabilities.

In order to take advantage of this, plugins can now implement
get_*_count() methods for their resources. This is used (if present)
by the quota checking function.

Patch incorporates review feedback from Dan W, Alex Xu, Zhongyue Luo,
Edgar Magana, Akihiro Motoki and gongysh.

Change-Id: I87e2d0294e116e8147fed2ee90c9eb0cf1a54362
2012-11-17 08:16:54 +13:00
..
2012-11-02 09:52:12 +08:00
2012-11-13 04:20:10 +09:00
2011-11-28 10:33:52 -08:00