support more kwargs to __init__
This commit is contained in:
parent
a0666acf89
commit
954312e0d6
1 changed files with 4 additions and 4 deletions
|
@ -1,10 +1,10 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# vi:si:et:sw=4:sts=4:ts=4
|
||||
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.models.sql import Query
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
from django.db import connections
|
||||
import django.db.models.query
|
||||
|
||||
'''
|
||||
models.py:
|
||||
|
@ -60,10 +60,10 @@ class Query(Query):
|
|||
return SQLCompiler(self, connection, using)
|
||||
|
||||
|
||||
class QuerySet(QuerySet):
|
||||
class QuerySet(django.db.models.query.QuerySet):
|
||||
|
||||
def __init__(self, model=None, query=None, using=None):
|
||||
super(QuerySet, self).__init__(model=model, query=query, using=None)
|
||||
def __init__(self, model=None, query=None, using=None, **kwargs):
|
||||
super(QuerySet, self).__init__(model=model, query=query, using=None, **kwargs)
|
||||
self.query = query or Query(self.model)
|
||||
|
||||
def order_by(self, *args, **kwargs):
|
||||
|
|
Loading…
Reference in a new issue