Skip to content

Commit cfd2ace

Browse files
committed
INTPYTHON-348 add support for QuerySet.raw_mql()
- Call super() on __init__s
1 parent 832a6a9 commit cfd2ace

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

django_mongodb/query.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,8 @@ def raw_mql(self, raw_query, params=(), translations=None, using=None):
321321

322322
class MongoRawQuery(RawQuery):
323323
def __init__(self, sql, using, model, params=()):
324-
self.params = params
325-
self.sql = sql
326-
self.using = using
327-
self.cursor = None
324+
super().__init__(sql, using, params)
328325
self.model = model
329-
self.low_mark, self.high_mark = 0, None # Used for offset/limit
330-
self.extra_select = {}
331-
self.annotation_select = {}
332326

333327
def __iter__(self):
334328
self.cursor = self._execute_query()
@@ -361,15 +355,10 @@ def __init__(
361355
using=None,
362356
hints=None,
363357
):
364-
self._prefetch_related_lookups = None
365-
self.model = model
366-
self._db = using
367-
self._hints = hints or {}
358+
super().__init__(model=model, query=query, using=using, hints=hints)
368359
self.query = query or MongoRawQuery(
369360
sql=raw_query, using=self.db, model=self.model, params=params
370361
)
371-
self._result_cache = None
372-
self.translations = translations or {}
373362

374363
def resolve_model_init_order(self):
375364
converter = connections[self.db].introspection.identifier_converter

0 commit comments

Comments
 (0)