We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Synchro mobile : Problème de pictogramme sur les thèmes 
Il arrive que la synchro-mobile soit en échec lors que des thèmes n'ont pas de pictogramme associés.

Après analyse, il s'avère que certains parsers semblent avoir créés automatiquement des thèmes sans pictogramme.

Deux approches possible : 

# Première approche

Dans cette méthode : https://github.com/GeotrekCE/Geotrek-admin/blob/6cf5f1fd3c1a4ee6605c86cb8661a79c63c573a5/geotrek/api/mobile/serializers/common.py#L144-L146

Rajouter un check pour savoir si un pictogramme est présent (évite à la synchro de casser)

# Seconde approche

Empêcher avec les parseurs de créer un thème sans pictogramme (mais dans ce cas quel pictogramme utiliser par défaut ?)

# A noter: 

- Les deux peuvent être fait.
- Si possible au passage corriger : https://github.com/GeotrekCE/Geotrek-admin/blob/6cf5f1fd3c1a4ee6605c86cb8661a79c63c573a5/geotrek/api/mobile/serializers/common.py#L105-L108

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `geotrek/api/mobile/serializers/common.py`
Content:
```
1 import os
2 
3 from django.conf import settings
4 from drf_dynamic_fields import DynamicFieldsMixin
5 from rest_framework import serializers
6 
7 from geotrek.common import models as common_models
8 from geotrek.flatpages import models as flatpage_models
9 from geotrek.trekking import models as trekking_models
10 
11 
12 if 'geotrek.zoning' in settings.INSTALLED_APPS:
13     from geotrek.zoning import models as zoning_models
14 
15     class DistrictSerializer(serializers.ModelSerializer):
16         class Meta:
17             model = zoning_models.District
18             fields = ('id', 'name')
19 
20     class CitySerializer(serializers.ModelSerializer):
21         id = serializers.ReadOnlyField(source='code')
22 
23         class Meta:
24             model = zoning_models.City
25             fields = ('id', 'name')
26 
27 if 'geotrek.tourism' in settings.INSTALLED_APPS:
28     from geotrek.tourism import models as tourism_models
29 
30     class InformationDeskTypeSerializer(serializers.ModelSerializer):
31         name = serializers.ReadOnlyField(source='label')
32         pictogram = serializers.SerializerMethodField()
33 
34         def get_pictogram(self, obj):
35             if not obj.pictogram:
36                 return None
37             file_name, file_extension = os.path.splitext(str(obj.pictogram.url))
38             return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url
39 
40         class Meta:
41             model = tourism_models.InformationDeskType
42             fields = ('id', 'name', 'pictogram')
43 
44     class TouristicContentTypeSerializer(serializers.ModelSerializer):
45         name = serializers.ReadOnlyField(source='label')
46         pictogram = serializers.SerializerMethodField()
47 
48         def get_pictogram(self, obj):
49             if not obj.pictogram:
50                 return None
51             file_name, file_extension = os.path.splitext(str(obj.pictogram.url))
52             return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url
53 
54         class Meta:
55             model = tourism_models.TouristicContentType
56             fields = ('id', 'name', 'pictogram')
57 
58     class TouristicEventTypeSerializer(serializers.ModelSerializer):
59         name = serializers.ReadOnlyField(source='type')
60         pictogram = serializers.SerializerMethodField()
61 
62         def get_pictogram(self, obj):
63             if not obj.pictogram:
64                 return None
65             file_name, file_extension = os.path.splitext(str(obj.pictogram.url))
66             return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url
67 
68         class Meta:
69             model = tourism_models.TouristicEventType
70             fields = ('id', 'name', 'pictogram')
71 
72     class TouristicContentCategorySerializer(serializers.ModelSerializer):
73         name = serializers.ReadOnlyField(source='label')
74         pictogram = serializers.SerializerMethodField()
75 
76         def get_pictogram(self, obj):
77             if not obj.pictogram:
78                 return None
79             file_name, file_extension = os.path.splitext(str(obj.pictogram.url))
80             return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url
81 
82         class Meta:
83             model = tourism_models.TouristicContentCategory
84             fields = ('id', 'name', 'pictogram', 'type1_label', 'type2_label', 'color')
85 
86 
87 if 'geotrek.trekking' in settings.INSTALLED_APPS:
88     class DifficultySerializer(DynamicFieldsMixin, serializers.ModelSerializer):
89         name = serializers.ReadOnlyField(source='difficulty')
90         pictogram = serializers.SerializerMethodField()
91 
92         def get_pictogram(self, obj):
93             if not obj.pictogram:
94                 return None
95             file_name, file_extension = os.path.splitext(str(obj.pictogram.url))
96             return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url
97 
98         class Meta:
99             model = trekking_models.DifficultyLevel
100             fields = ('id', 'name', 'pictogram')
101 
102     class PracticeSerializer(serializers.ModelSerializer):
103         pictogram = serializers.SerializerMethodField()
104 
105         def get_pictogram(self, obj):
106             file_name, file_extension = os.path.splitext(str(obj.pictogram.url))
107             return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url
108 
109         class Meta:
110             model = trekking_models.Practice
111             fields = ('id', 'name', 'slug', 'pictogram', 'color')
112 
113     class AccessibilitySerializer(serializers.ModelSerializer):
114         pictogram = serializers.SerializerMethodField()
115 
116         def get_pictogram(self, obj):
117             if not obj.pictogram:
118                 return None
119             file_name, file_extension = os.path.splitext(str(obj.pictogram.url))
120             return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url
121 
122         class Meta:
123             model = trekking_models.Accessibility
124             fields = ('id', 'name', 'pictogram',)
125 
126     class RouteSerializer(serializers.ModelSerializer):
127         name = serializers.ReadOnlyField(source='route')
128         pictogram = serializers.SerializerMethodField()
129 
130         def get_pictogram(self, obj):
131             if not obj.pictogram:
132                 return None
133             file_name, file_extension = os.path.splitext(str(obj.pictogram.url))
134             return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url
135 
136         class Meta:
137             model = trekking_models.Route
138             fields = ('id', 'name', 'pictogram',)
139 
140     class ThemeSerializer(serializers.ModelSerializer):
141         name = serializers.ReadOnlyField(source='label')
142         pictogram = serializers.SerializerMethodField()
143 
144         def get_pictogram(self, obj):
145             file_name, file_extension = os.path.splitext(str(obj.pictogram.url))
146             return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url
147 
148         class Meta:
149             model = common_models.Theme
150             fields = ('id', 'name', 'pictogram')
151 
152     class NetworkSerializer(serializers.ModelSerializer):
153         name = serializers.ReadOnlyField(source='network')
154         pictogram = serializers.SerializerMethodField()
155 
156         def get_pictogram(self, obj):
157             if not obj.pictogram:
158                 return None
159             file_name, file_extension = os.path.splitext(str(obj.pictogram.url))
160             return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url
161 
162         class Meta:
163             model = trekking_models.TrekNetwork
164             fields = ('id', 'name', 'pictogram')
165 
166     class POITypeSerializer(serializers.ModelSerializer):
167         pictogram = serializers.SerializerMethodField()
168 
169         def get_pictogram(self, obj):
170             if not obj.pictogram:
171                 return None
172             file_name, file_extension = os.path.splitext(str(obj.pictogram.url))
173             return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url
174 
175         class Meta:
176             model = trekking_models.POIType
177             fields = ('id', 'label', 'pictogram')
178 
179 
180 class FlatPageListSerializer(serializers.ModelSerializer):
181     class Meta:
182         model = flatpage_models.FlatPage
183         fields = ('id', 'title')
184 
185 
186 class FlatPageDetailSerializer(serializers.ModelSerializer):
187     class Meta:
188         model = flatpage_models.FlatPage
189         fields = ('id', 'title', 'content', 'external_url')
190
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/geotrek/api/mobile/serializers/common.py b/geotrek/api/mobile/serializers/common.py
--- a/geotrek/api/mobile/serializers/common.py
+++ b/geotrek/api/mobile/serializers/common.py
@@ -103,6 +103,8 @@
         pictogram = serializers.SerializerMethodField()
 
         def get_pictogram(self, obj):
+            if not obj.pictogram:
+                return None
             file_name, file_extension = os.path.splitext(str(obj.pictogram.url))
             return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url
 
@@ -142,6 +144,8 @@
         pictogram = serializers.SerializerMethodField()
 
         def get_pictogram(self, obj):
+            if not obj.pictogram:
+                return None
             file_name, file_extension = os.path.splitext(str(obj.pictogram.url))
             return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url

{"golden_diff": "diff --git a/geotrek/api/mobile/serializers/common.py b/geotrek/api/mobile/serializers/common.py\n--- a/geotrek/api/mobile/serializers/common.py\n+++ b/geotrek/api/mobile/serializers/common.py\n@@ -103,6 +103,8 @@\n         pictogram = serializers.SerializerMethodField()\n \n         def get_pictogram(self, obj):\n+            if not obj.pictogram:\n+                return None\n             file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n             return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n \n@@ -142,6 +144,8 @@\n         pictogram = serializers.SerializerMethodField()\n \n         def get_pictogram(self, obj):\n+            if not obj.pictogram:\n+                return None\n             file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n             return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n", "issue": "Synchro mobile : Probl\u00e8me de pictogramme sur les th\u00e8mes \nIl arrive que la synchro-mobile soit en \u00e9chec lors que des th\u00e8mes n'ont pas de pictogramme associ\u00e9s.\r\n\r\nApr\u00e8s analyse, il s'av\u00e8re que certains parsers semblent avoir cr\u00e9\u00e9s automatiquement des th\u00e8mes sans pictogramme.\r\n\r\nDeux approches possible\u00a0: \r\n\r\n# Premi\u00e8re approche\r\n\r\nDans cette m\u00e9thode : https://github.com/GeotrekCE/Geotrek-admin/blob/6cf5f1fd3c1a4ee6605c86cb8661a79c63c573a5/geotrek/api/mobile/serializers/common.py#L144-L146\r\n\r\nRajouter un check pour savoir si un pictogramme est pr\u00e9sent (\u00e9vite \u00e0 la synchro de casser)\r\n\r\n# Seconde approche\r\n\r\nEmp\u00eacher avec les parseurs de cr\u00e9er un th\u00e8me sans pictogramme (mais dans ce cas quel pictogramme utiliser par d\u00e9faut ?)\r\n\r\n# A noter: \r\n\r\n- Les deux peuvent \u00eatre fait.\r\n- Si possible au passage corriger : https://github.com/GeotrekCE/Geotrek-admin/blob/6cf5f1fd3c1a4ee6605c86cb8661a79c63c573a5/geotrek/api/mobile/serializers/common.py#L105-L108\n", "before_files": [{"content": "import os\n\nfrom django.conf import settings\nfrom drf_dynamic_fields import DynamicFieldsMixin\nfrom rest_framework import serializers\n\nfrom geotrek.common import models as common_models\nfrom geotrek.flatpages import models as flatpage_models\nfrom geotrek.trekking import models as trekking_models\n\n\nif 'geotrek.zoning' in settings.INSTALLED_APPS:\n    from geotrek.zoning import models as zoning_models\n\n    class DistrictSerializer(serializers.ModelSerializer):\n        class Meta:\n            model = zoning_models.District\n            fields = ('id', 'name')\n\n    class CitySerializer(serializers.ModelSerializer):\n        id = serializers.ReadOnlyField(source='code')\n\n        class Meta:\n            model = zoning_models.City\n            fields = ('id', 'name')\n\nif 'geotrek.tourism' in settings.INSTALLED_APPS:\n    from geotrek.tourism import models as tourism_models\n\n    class InformationDeskTypeSerializer(serializers.ModelSerializer):\n        name = serializers.ReadOnlyField(source='label')\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = tourism_models.InformationDeskType\n            fields = ('id', 'name', 'pictogram')\n\n    class TouristicContentTypeSerializer(serializers.ModelSerializer):\n        name = serializers.ReadOnlyField(source='label')\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = tourism_models.TouristicContentType\n            fields = ('id', 'name', 'pictogram')\n\n    class TouristicEventTypeSerializer(serializers.ModelSerializer):\n        name = serializers.ReadOnlyField(source='type')\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = tourism_models.TouristicEventType\n            fields = ('id', 'name', 'pictogram')\n\n    class TouristicContentCategorySerializer(serializers.ModelSerializer):\n        name = serializers.ReadOnlyField(source='label')\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = tourism_models.TouristicContentCategory\n            fields = ('id', 'name', 'pictogram', 'type1_label', 'type2_label', 'color')\n\n\nif 'geotrek.trekking' in settings.INSTALLED_APPS:\n    class DifficultySerializer(DynamicFieldsMixin, serializers.ModelSerializer):\n        name = serializers.ReadOnlyField(source='difficulty')\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = trekking_models.DifficultyLevel\n            fields = ('id', 'name', 'pictogram')\n\n    class PracticeSerializer(serializers.ModelSerializer):\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = trekking_models.Practice\n            fields = ('id', 'name', 'slug', 'pictogram', 'color')\n\n    class AccessibilitySerializer(serializers.ModelSerializer):\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = trekking_models.Accessibility\n            fields = ('id', 'name', 'pictogram',)\n\n    class RouteSerializer(serializers.ModelSerializer):\n        name = serializers.ReadOnlyField(source='route')\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = trekking_models.Route\n            fields = ('id', 'name', 'pictogram',)\n\n    class ThemeSerializer(serializers.ModelSerializer):\n        name = serializers.ReadOnlyField(source='label')\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = common_models.Theme\n            fields = ('id', 'name', 'pictogram')\n\n    class NetworkSerializer(serializers.ModelSerializer):\n        name = serializers.ReadOnlyField(source='network')\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = trekking_models.TrekNetwork\n            fields = ('id', 'name', 'pictogram')\n\n    class POITypeSerializer(serializers.ModelSerializer):\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = trekking_models.POIType\n            fields = ('id', 'label', 'pictogram')\n\n\nclass FlatPageListSerializer(serializers.ModelSerializer):\n    class Meta:\n        model = flatpage_models.FlatPage\n        fields = ('id', 'title')\n\n\nclass FlatPageDetailSerializer(serializers.ModelSerializer):\n    class Meta:\n        model = flatpage_models.FlatPage\n        fields = ('id', 'title', 'content', 'external_url')\n", "path": "geotrek/api/mobile/serializers/common.py"}], "after_files": [{"content": "import os\n\nfrom django.conf import settings\nfrom drf_dynamic_fields import DynamicFieldsMixin\nfrom rest_framework import serializers\n\nfrom geotrek.common import models as common_models\nfrom geotrek.flatpages import models as flatpage_models\nfrom geotrek.trekking import models as trekking_models\n\n\nif 'geotrek.zoning' in settings.INSTALLED_APPS:\n    from geotrek.zoning import models as zoning_models\n\n    class DistrictSerializer(serializers.ModelSerializer):\n        class Meta:\n            model = zoning_models.District\n            fields = ('id', 'name')\n\n    class CitySerializer(serializers.ModelSerializer):\n        id = serializers.ReadOnlyField(source='code')\n\n        class Meta:\n            model = zoning_models.City\n            fields = ('id', 'name')\n\nif 'geotrek.tourism' in settings.INSTALLED_APPS:\n    from geotrek.tourism import models as tourism_models\n\n    class InformationDeskTypeSerializer(serializers.ModelSerializer):\n        name = serializers.ReadOnlyField(source='label')\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = tourism_models.InformationDeskType\n            fields = ('id', 'name', 'pictogram')\n\n    class TouristicContentTypeSerializer(serializers.ModelSerializer):\n        name = serializers.ReadOnlyField(source='label')\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = tourism_models.TouristicContentType\n            fields = ('id', 'name', 'pictogram')\n\n    class TouristicEventTypeSerializer(serializers.ModelSerializer):\n        name = serializers.ReadOnlyField(source='type')\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = tourism_models.TouristicEventType\n            fields = ('id', 'name', 'pictogram')\n\n    class TouristicContentCategorySerializer(serializers.ModelSerializer):\n        name = serializers.ReadOnlyField(source='label')\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = tourism_models.TouristicContentCategory\n            fields = ('id', 'name', 'pictogram', 'type1_label', 'type2_label', 'color')\n\n\nif 'geotrek.trekking' in settings.INSTALLED_APPS:\n    class DifficultySerializer(DynamicFieldsMixin, serializers.ModelSerializer):\n        name = serializers.ReadOnlyField(source='difficulty')\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = trekking_models.DifficultyLevel\n            fields = ('id', 'name', 'pictogram')\n\n    class PracticeSerializer(serializers.ModelSerializer):\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = trekking_models.Practice\n            fields = ('id', 'name', 'slug', 'pictogram', 'color')\n\n    class AccessibilitySerializer(serializers.ModelSerializer):\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = trekking_models.Accessibility\n            fields = ('id', 'name', 'pictogram',)\n\n    class RouteSerializer(serializers.ModelSerializer):\n        name = serializers.ReadOnlyField(source='route')\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = trekking_models.Route\n            fields = ('id', 'name', 'pictogram',)\n\n    class ThemeSerializer(serializers.ModelSerializer):\n        name = serializers.ReadOnlyField(source='label')\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = common_models.Theme\n            fields = ('id', 'name', 'pictogram')\n\n    class NetworkSerializer(serializers.ModelSerializer):\n        name = serializers.ReadOnlyField(source='network')\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = trekking_models.TrekNetwork\n            fields = ('id', 'name', 'pictogram')\n\n    class POITypeSerializer(serializers.ModelSerializer):\n        pictogram = serializers.SerializerMethodField()\n\n        def get_pictogram(self, obj):\n            if not obj.pictogram:\n                return None\n            file_name, file_extension = os.path.splitext(str(obj.pictogram.url))\n            return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url\n\n        class Meta:\n            model = trekking_models.POIType\n            fields = ('id', 'label', 'pictogram')\n\n\nclass FlatPageListSerializer(serializers.ModelSerializer):\n    class Meta:\n        model = flatpage_models.FlatPage\n        fields = ('id', 'title')\n\n\nclass FlatPageDetailSerializer(serializers.ModelSerializer):\n    class Meta:\n        model = flatpage_models.FlatPage\n        fields = ('id', 'title', 'content', 'external_url')\n", "path": "geotrek/api/mobile/serializers/common.py"}]}