-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #57, Django 1.8 compatibility.
- Loading branch information
Showing
6 changed files
with
56 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
__all__ = ('bitand', 'bitor') | ||
|
||
def bitand(a, b): | ||
return a.bitand(b) | ||
|
||
def bitor(a, b): | ||
return a.bitor(b) | ||
|
||
try: | ||
from django.db.models.expressions import ExpressionNode | ||
ExpressionNode.BITAND # noqa | ||
del ExpressionNode | ||
except ImportError: | ||
# Django >= 1.8 | ||
pass | ||
except AttributeError: | ||
# Django < 1.5 | ||
def bitand(a, b): | ||
return a & b | ||
|
||
def bitor(a, b): | ||
return a | b | ||
else: | ||
def bitand(a, b): | ||
return a.bitand(b) | ||
|
||
def bitor(a, b): | ||
return a.bitor(b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
from django import forms | ||
from bitfield.tests.models import BitFieldTestModel, CompositeBitFieldTestModel | ||
|
||
|
||
class BitFieldTestModelForm(forms.ModelForm): | ||
|
||
class Meta: | ||
model = BitFieldTestModel | ||
exclude = tuple() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters