Skip to content

Commit 1831ceb

Browse files
committed
Clean up.
1 parent c48229f commit 1831ceb

File tree

5 files changed

+2
-98
lines changed

5 files changed

+2
-98
lines changed

django_mongodb/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66

77
check_django_compatability()
88

9-
from .datastructures import register_datastructures # noqa: E402
109
from .expressions import register_expressions # noqa: E402
1110
from .fields import register_fields # noqa: E402
1211
from .functions import register_functions # noqa: E402
1312
from .lookups import register_lookups # noqa: E402
1413
from .query import register_nodes # noqa: E402
1514

16-
register_datastructures()
1715
register_expressions()
1816
register_fields()
1917
register_functions()

django_mongodb/compiler.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,6 @@ def _make_result(self, entity, columns):
7373
The entity is assumed to be a dict using field database column
7474
names as keys.
7575
"""
76-
result = self._apply_converters(entity, columns, converters)
77-
if tuple_expected:
78-
result = tuple(result)
79-
return result
80-
81-
def _apply_converters(self, entity, columns, converters):
8276
result = []
8377
for name, col in columns:
8478
column_alias = getattr(col, "alias", None)
@@ -141,6 +135,7 @@ def get_count(self, check_exists=False):
141135
def build_query(self, columns=None):
142136
"""Check if the query is supported and prepare a MongoQuery."""
143137
self.check_query()
138+
self.setup_query()
144139
query = self.query_class(self, columns)
145140
query.lookup_pipeline = self.get_lookup_pipeline()
146141
try:

django_mongodb/datastructures.py

Lines changed: 0 additions & 75 deletions
This file was deleted.

django_mongodb/operations.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from django.conf import settings
99
from django.db import DataError
1010
from django.db.backends.base.operations import BaseDatabaseOperations
11-
from django.db.models.expressions import Col, Combinable
11+
from django.db.models.expressions import Combinable
1212
from django.utils import timezone
1313
from django.utils.regex_helper import _lazy_re_compile
1414

@@ -176,12 +176,6 @@ def execute_sql_flush(self, tables):
176176
if not options.get("capped", False):
177177
collection.drop()
178178

179-
def prepare_join_on_clause(self, lhs_table, lhs_field, rhs_table, rhs_field):
180-
lhs_expr = Col(lhs_table, lhs_field)
181-
rhs_expr = Col(rhs_table, rhs_field)
182-
183-
return lhs_expr, rhs_expr
184-
185179
def prep_lookup_value(self, value, field, lookup):
186180
"""
187181
Perform type-conversion on `value` before using as a filter parameter.

django_mongodb/query.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def __init__(self, compiler, columns):
4545
self.columns = columns
4646
self._negated = False
4747
self.ordering = []
48-
self.collection_name = self.compiler.collection_name
4948
self.collection = self.compiler.get_collection()
5049
self.collection_name = self.compiler.collection_name
5150
self.mongo_query = getattr(compiler.query, "raw_query", {})
@@ -124,13 +123,6 @@ def get_cursor(self):
124123
pipeline = []
125124
if self.lookup_pipeline:
126125
pipeline.extend(self.lookup_pipeline)
127-
128-
# Add the subquery results if fields is defined.
129-
if fields:
130-
for alias in self.query.alias_map:
131-
if self.query.alias_refcount[alias] and self.collection_name != alias:
132-
fields[alias] = 1
133-
134126
if self.mongo_query:
135127
pipeline.append({"$match": self.mongo_query})
136128
if fields:

0 commit comments

Comments
 (0)