-
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.
Merge pull request #58 from greyside/master
Django 1.8 Compatibility
- Loading branch information
Showing
10 changed files
with
105 additions
and
15 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
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,3 +1,2 @@ | ||
from .forms import * | ||
from .models import * | ||
from .tests import * |
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
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