-
Notifications
You must be signed in to change notification settings - Fork 19
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 #28 from adepue/master
Add 1.9 support
- Loading branch information
Showing
7 changed files
with
28 additions
and
23 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
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,18 +1,21 @@ | ||
from model_utils.managers import PassThroughManager | ||
from django.db import models | ||
|
||
from .querysets import LiveGeoQuerySet | ||
|
||
|
||
class LiveGeoManager(PassThroughManager): | ||
LiveGeoManagerBase = models.Manager.from_queryset(LiveGeoQuerySet) | ||
|
||
|
||
class LiveGeoManager(LiveGeoManagerBase): | ||
# To also use this manager for FK lookups, see | ||
# https://docs.djangoproject.com/en/1.6/topics/db/managers/#manager-types. | ||
|
||
def __init__(self, queryset_cls=LiveGeoQuerySet, include_soft_deleted=False, *args, **kwargs): | ||
def __init__(self, include_soft_deleted=False, *args, **kwargs): | ||
self.include_soft_deleted = include_soft_deleted | ||
super(LiveGeoManager, self).__init__(queryset_cls=queryset_cls, *args, **kwargs) | ||
super(LiveGeoManager, self).__init__(*args, **kwargs) # pylint: disable=super-on-old-class | ||
|
||
def get_queryset(self): | ||
qs = super(LiveGeoManager, self).get_queryset() | ||
qs = super(LiveGeoManager, self).get_queryset() # pylint: disable=super-on-old-class | ||
if not self.include_soft_deleted: | ||
return qs.live() | ||
return qs |
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,18 +1,21 @@ | ||
from model_utils.managers import PassThroughManager | ||
from django.db import models | ||
|
||
from .querysets import LiveQuerySet | ||
|
||
|
||
class LiveManager(PassThroughManager): | ||
LiveManagerBase = models.Manager.from_queryset(LiveQuerySet) | ||
|
||
|
||
class LiveManager(LiveManagerBase): | ||
# To also use this manager for FK lookups, see | ||
# https://docs.djangoproject.com/en/1.6/topics/db/managers/#manager-types. | ||
|
||
def __init__(self, queryset_cls=LiveQuerySet, include_soft_deleted=False, *args, **kwargs): | ||
def __init__(self, include_soft_deleted=False, *args, **kwargs): | ||
self.include_soft_deleted = include_soft_deleted | ||
super(LiveManager, self).__init__(queryset_cls=queryset_cls, *args, **kwargs) | ||
super(LiveManager, self).__init__(*args, **kwargs) # pylint: disable=super-on-old-class | ||
|
||
def get_queryset(self): | ||
qs = super(LiveManager, self).get_queryset() | ||
qs = super(LiveManager, self).get_queryset() # pylint: disable=super-on-old-class | ||
if not self.include_soft_deleted: | ||
return qs.live() | ||
return qs |
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