-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
394 additions
and
81 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
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,15 +1,10 @@ | ||
from geotrek.common.mixins.managers import NoDeleteManager | ||
from geotrek.common.mixins.managers import NoDeleteManager, ProviderChoicesMixin | ||
|
||
|
||
class InfrastructureGISManager(NoDeleteManager): | ||
class InfrastructureGISManager(NoDeleteManager, ProviderChoicesMixin): | ||
""" Override default typology mixin manager""" | ||
def implantation_year_choices(self): | ||
values = self.get_queryset().existing().filter(implantation_year__isnull=False)\ | ||
.order_by('-implantation_year').distinct('implantation_year') \ | ||
.values_list('implantation_year', flat=True) | ||
return tuple((value, value) for value in values) | ||
|
||
def provider_choices(self): | ||
providers = self.get_queryset().existing().exclude(provider__exact='') \ | ||
.distinct('provider').values_list('provider', 'provider') | ||
return providers |
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
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,8 +1,5 @@ | ||
from geotrek.common.mixins.managers import NoDeleteManager | ||
from geotrek.common.mixins.managers import NoDeleteManager, ProviderChoicesMixin | ||
|
||
|
||
class SensitiveAreaManager(NoDeleteManager): | ||
def provider_choices(self): | ||
providers = self.get_queryset().existing().exclude(provider__exact='') \ | ||
.distinct('provider').values_list('provider', 'provider') | ||
return providers | ||
class SensitiveAreaManager(NoDeleteManager, ProviderChoicesMixin): | ||
pass |
Oops, something went wrong.