Skip to content

Commit 47f7bdb

Browse files
committed
fix(tests): fix database setup for Django < 1.4
This fixes the TypeError that occurs during the database setup for the testsuite in Django < 1.4. Removing some of the class attributes allows for the 'inner()' method to be called from the BaseField 'instance' instead of the PickedObjectField. Example error: TypeError: unbound method inner() must be called with BaseField instance as first argument (got PickledObjectField instance instead)
1 parent 068873b commit 47f7bdb

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

djcelery/picklefield.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
"""
1515
from __future__ import absolute_import, unicode_literals
1616

17-
import django
18-
1917
from base64 import b64encode, b64decode
2018
from zlib import compress, decompress
2119

@@ -35,12 +33,12 @@
3533
NO_DECOMPRESS_HEADER = b'\x1e\x00r8d9qwwerwhA@'
3634

3735

38-
if django.VERSION < (1, 3):
39-
BaseField = models.Field
40-
else:
41-
@with_metaclass(models.SubfieldBase)
42-
class BaseField(models.Field):
43-
pass
36+
@with_metaclass(models.SubfieldBase, skip_attrs=set([
37+
'db_type',
38+
'get_db_prep_save'
39+
]))
40+
class BaseField(models.Field):
41+
pass
4442

4543

4644
class PickledObject(str):

0 commit comments

Comments
 (0)