Run black over entire codebase
This commit is contained in:
@ -12,7 +12,7 @@ from apps.map.models import CaseStudy, PointOfInterest
|
||||
from . import views
|
||||
|
||||
apirouter = routers.DefaultRouter()
|
||||
apirouter.register(r'case-studies', views.CaseStudyViewSet)
|
||||
apirouter.register(r'points-of-interest', views.PointOfInterestViewSet)
|
||||
apirouter.register(r"case-studies", views.CaseStudyViewSet)
|
||||
apirouter.register(r"points-of-interest", views.PointOfInterestViewSet)
|
||||
|
||||
urlpatterns = apirouter.urls
|
||||
|
@ -13,7 +13,7 @@ from apps.map.models import CaseStudy, PointOfInterest
|
||||
class UserSerializer(serializers.HyperlinkedModelSerializer):
|
||||
class Meta:
|
||||
model = User
|
||||
fields = ('url', 'username', 'email', 'is_staff')
|
||||
fields = ("url", "username", "email", "is_staff")
|
||||
|
||||
|
||||
class UserViewSet(viewsets.ModelViewSet):
|
||||
@ -24,28 +24,30 @@ class UserViewSet(viewsets.ModelViewSet):
|
||||
class FileSerializer(serializers.HyperlinkedModelSerializer):
|
||||
class Meta:
|
||||
model = File
|
||||
fields = ('file',)
|
||||
fields = ("file",)
|
||||
|
||||
|
||||
class CaseStudySerializer(gis_serializers.GeoFeatureModelSerializer):
|
||||
sector_of_economy = serializers.CharField(source='get_sector_of_economy_display')
|
||||
country_name = serializers.CharField(source='get_country_display')
|
||||
positive_or_negative_display = serializers.CharField(source='get_positive_or_negative_display')
|
||||
sector_of_economy = serializers.CharField(source="get_sector_of_economy_display")
|
||||
country_name = serializers.CharField(source="get_country_display")
|
||||
positive_or_negative_display = serializers.CharField(
|
||||
source="get_positive_or_negative_display"
|
||||
)
|
||||
images = FileSerializer(many=True)
|
||||
|
||||
class Meta:
|
||||
model = CaseStudy
|
||||
geo_field = "location"
|
||||
fields = (
|
||||
'country',
|
||||
'country_name',
|
||||
'entry_name',
|
||||
'images',
|
||||
'location',
|
||||
'positive_or_negative',
|
||||
'positive_or_negative_display',
|
||||
'sector_of_economy',
|
||||
'slug'
|
||||
"country",
|
||||
"country_name",
|
||||
"entry_name",
|
||||
"images",
|
||||
"location",
|
||||
"positive_or_negative",
|
||||
"positive_or_negative_display",
|
||||
"sector_of_economy",
|
||||
"slug",
|
||||
)
|
||||
|
||||
|
||||
@ -54,20 +56,13 @@ class CaseStudyViewSet(viewsets.ModelViewSet):
|
||||
serializer_class = CaseStudySerializer
|
||||
|
||||
|
||||
|
||||
class PointOfInterestSerializer(gis_serializers.GeoFeatureModelSerializer):
|
||||
class Meta:
|
||||
model = PointOfInterest
|
||||
geo_field = "location"
|
||||
fields = (
|
||||
'title',
|
||||
'synopsis',
|
||||
'link',
|
||||
'slug'
|
||||
)
|
||||
fields = ("title", "synopsis", "link", "slug")
|
||||
|
||||
|
||||
class PointOfInterestViewSet(viewsets.ModelViewSet):
|
||||
queryset = PointOfInterest.objects.approved()
|
||||
serializer_class = PointOfInterestSerializer
|
||||
|
||||
|
Reference in New Issue
Block a user