Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

Commit

Permalink
Merge pull request #2 from brki/simplify-VersionedQuerySet-init
Browse files Browse the repository at this point in the history
simplify VersionedQuerySet 1.6 and 1.7 compatible __init__
  • Loading branch information
maennel committed Sep 12, 2014
2 parents 2b3ee8c + 0819559 commit f2c1c1a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions versions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import copy
import datetime
from django import VERSION
from django.core.exceptions import SuspiciousOperation, MultipleObjectsReturned, ObjectDoesNotExist
from django.db.models.constants import LOOKUP_SEP

Expand Down Expand Up @@ -151,11 +150,8 @@ class VersionedQuerySet(QuerySet):

query_time = None

def __init__(self, model=None, query=None, using=None, hints=None):
if VERSION >= (1, 7): # Ensure the correct constructor for Django >= v1.7
super(VersionedQuerySet, self).__init__(model, query, using, hints)
else: # For Django 1.6, take the former constructor
super(VersionedQuerySet, self).__init__(model, query, using)
def __init__(self, *args, **kwargs):
super(VersionedQuerySet, self).__init__(*args, **kwargs)

self.related_table_in_filter = set()
"""We will store in it all the tables we have being using in while filtering."""
Expand Down

0 comments on commit f2c1c1a

Please sign in to comment.