Comments (5)
do any of the non-rel backends support subqueries? i know appengine doesn't, so if the others also don't, we could raise an exception.
from djangotoolbox.
Wilfred, what happens if you put a len(...)
around input number 8? Maybe Django swallows exceptions (if an exception happens in the backend, Django simply returns the empty list)
from djangotoolbox.
In [8]: len(Wheel.objects.filter(part_of__in=cars))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/home/wilfred/work/gap2/<ipython-input-8-072b023c1483> in <module>()
----> 1 len(Wheel.objects.filter(part_of__in=cars))
/home/wilfred/work/gap2/django/db/models/query.py in __len__(self)
81 self._result_cache = list(self._iter)
82 else:
---> 83 self._result_cache = list(self.iterator())
84 elif self._iter:
85 self._result_cache.extend(self._iter)
/home/wilfred/work/gap2/django/db/models/query.py in iterator(self)
274 model = self.model
275 compiler = self.query.get_compiler(using=db)
--> 276 for row in compiler.results_iter():
277 if fill_cache:
278 obj, _ = get_cached_row(model, row,
/home/wilfred/work/gap2/djangotoolbox/db/basecompiler.py in results_iter(self)
227 low_mark = self.query.low_mark
228 high_mark = self.query.high_mark
--> 229 for entity in self.build_query(fields).fetch(low_mark, high_mark):
230 yield self._make_result(entity, fields)
231
/home/wilfred/work/gap2/djangotoolbox/db/basecompiler.py in build_query(self, fields)
287 fields = self.get_fields()
288 query = self.query_class(self, fields)
--> 289 query.add_filters(self.query.where)
290 query.order_by(self._get_ordering())
291
/home/wilfred/work/gap2/djangotoolbox/db/basecompiler.py in add_filters(self, filters)
72 for child in children:
73 if isinstance(child, Node):
---> 74 self.add_filters(child)
75 continue
76
/home/wilfred/work/gap2/djangotoolbox/db/basecompiler.py in add_filters(self, filters)
76
77 column, lookup_type, db_type, value = self._decode_child(child)
---> 78 self.add_filter(column, lookup_type, self._negated, db_type, value)
79
80 if filters.negated:
/home/wilfred/work/gap2/djangoappengine/db/compiler.py in _func(*args, **kwargs)
59 def _func(*args, **kwargs):
60 try:
---> 61 return func(*args, **kwargs)
62 except GAEError, e:
63 raise DatabaseError, DatabaseError(str(e)), sys.exc_info()[2]
/home/wilfred/work/gap2/djangoappengine/db/compiler.py in add_filter(self, column, lookup_type, negated, db_type, value)
241 elif lookup_type == 'in':
242 # Create sub-query combinations, one for each value
--> 243 if len(self.gae_query) * len(value) > 30:
244 raise DatabaseError("You can't query against more than "
245 "30 __in filter value combinations")
TypeError: object of type 'QueryWrapper' has no len()
from djangotoolbox.
Okay so we need a test in djangotoolbox for this and a fix in either djangoappengine or djangotoolbox, depending on which code is broken
from djangotoolbox.
An exception should be raised if a subquery is used with the recent changes. However, we could try to evaluate subqueries or avoid them when constructing queries.
from djangotoolbox.
Related Issues (20)
- django.utils.timezone is not available in djangoappengine yet HOT 1
- NoReverseMatch at /admin/auth/user/52ade053f9bed911e71dfa5e/ HOT 1
- Allow Distinct Queries HOT 2
- Nonetype object has no attribute 'model' HOT 1
- Please add documentation HOT 1
- Add ordering by fields in embedded models or dicts
- Support for max_length for ListField and SetField
- Incompatibility with Django 1.7
- python 2 print statement on test files cause exception HOT 1
- Incompatability With Django 1.8 HOT 7
- DatabaseError: Unsupported type for property : <class 'django.utils.safestring.SafeText'> HOT 6
- Bug fix
- No support DateTimeField ? is it be design ?
- Please delete this issue. Unable to remove it.
- This database doesn't support filtering on non-primary key ForeignKey fields.
- RemovedInDjango110Warning: SubfieldBase has been deprecated HOT 3
- No module named from django.utils.importlib import import_module
- importlib issue after installing django 1.11 HOT 5
- DynamicSiteIDMiddleware fails when application when the request.host is an IPv6 address
- Cert errors related to stale docs build
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from djangotoolbox.