You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@allura.apache.org by Dave Brondsema <br...@users.sf.net> on 2013/07/01 16:53:10 UTC
[allura:tickets] #6431 Upgrade to ming 0.4 to avoid extraneous count()
queries
---
** [tickets:#6431] Upgrade to ming 0.4 to avoid extraneous count() queries**
**Status:** open
**Labels:** performance
**Created:** Mon Jul 01, 2013 02:53 PM UTC by Dave Brondsema
**Last Updated:** Mon Jul 01, 2013 02:53 PM UTC
**Owner:** nobody
Ming 0.4 removes the `__len__` method which does a count() query. This is so that list(query) and query.all() don't cause that to run any more.
We'll need to find & change all our `len(query)` and `query|length` (in templates) to `query.count()`.
If we're not comfortable with finding these manually via test runs, searching, and exercising all parts of Allura, we could potentially add support in Ming to inspect the frame within `__len__` and if it's not a call from `list()` then raise a DeprecationWarning. (We can't simply raise DeprecationWarning all the time since list(query) automatically calls `__len__` under the covers)
---
Sent from sourceforge.net because allura-dev@incubator.apache.org is subscribed to https://sourceforge.net/p/allura/tickets/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/allura/admin/tickets/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.