diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-12-19 13:06:45 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-12-19 13:06:45 +0000 |
| commit | 7292cc8d60f9e993c26755456468cfd4cd8eb03e (patch) | |
| tree | bbd9f6b9e8c256ac1c0b4c34b453833e8ac06872 /django/db/models/sql | |
| parent | 4dc766c9e1912dd0858c8ef80197fe2a3bb1ec92 (diff) | |
queryset-refactor: Reverted [6762] because it generates invalid SQL. It only worked accidentally with SQLite.
Refs #4002.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6961 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/sql')
| -rw-r--r-- | django/db/models/sql/query.py | 12 | ||||
| -rw-r--r-- | django/db/models/sql/where.py | 6 |
2 files changed, 3 insertions, 15 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 35dfbcb12f..2f7a08e4dd 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -723,16 +723,8 @@ class Query(object): opts = self.model._meta alias = self.join((None, opts.db_table, None, None)) - try: - field, target, unused, join_list = self.setup_joins(parts, opts, - alias, (connector == AND)) - except TypeError, e: - if len(parts) != 1 or parts[0] not in self.extra_select: - raise e - # Filtering on some alias from extra(select=...) - self.where.add([None, parts[0], None, lookup_type, value], - connector) - return + field, target, unused, join_list, = self.setup_joins(parts, opts, + alias, (connector == AND)) col = target.column alias = join_list[-1][-1] diff --git a/django/db/models/sql/where.py b/django/db/models/sql/where.py index 97e6c38e6b..d361916953 100644 --- a/django/db/models/sql/where.py +++ b/django/db/models/sql/where.py @@ -5,7 +5,6 @@ import datetime from django.utils import tree from django.db import connection -from django.db.models.fields import Field from datastructures import EmptyResultSet # Connection types @@ -103,10 +102,7 @@ class WhereNode(tree.Node): else: format = '%s %s' - if field: - params = field.get_db_prep_lookup(lookup_type, value) - else: - params = Field().get_db_prep_lookup(lookup_type, value) + params = field.get_db_prep_lookup(lookup_type, value) if lookup_type in connection.operators: return (format % (field_sql, |
