-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop support for Django < 1.8 (#295)
* Drop support for Django < 1.8 * Cleanup * Fix dependency
- Loading branch information
1 parent
3afce1b
commit 813c785
Showing
28 changed files
with
114 additions
and
680 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
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,25 +1,16 @@ | ||
# coding: utf-8 | ||
from django import VERSION | ||
import django.contrib.admin.utils as admin_utils | ||
|
||
from ._compat import admin_utils, text_type | ||
from ._compat import text_type | ||
from .models.fields import MoneyField | ||
|
||
|
||
def setup_admin_integration(): | ||
original_display_for_field = admin_utils.display_for_field | ||
|
||
if VERSION < (1, 7): | ||
|
||
def display_for_field(value, field): | ||
if isinstance(field, MoneyField): | ||
return text_type(value) | ||
return original_display_for_field(value, field) | ||
|
||
else: | ||
|
||
def display_for_field(value, field, empty): | ||
if isinstance(field, MoneyField): | ||
return text_type(value) | ||
return original_display_for_field(value, field, empty) | ||
def display_for_field(value, field, empty): | ||
if isinstance(field, MoneyField): | ||
return text_type(value) | ||
return original_display_for_field(value, field, empty) | ||
|
||
admin_utils.display_for_field = display_for_field |
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 @@ | ||
# -*- coding: utf-8 -*- | ||
from .fields import MoneyField, register_money_field # noqa | ||
from .helpers import VERSION # noqa |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.