We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
TRAIL filters
Add "communes, secteurs, type physique, type foncier..." for TRAILS filters as it is in other modules.


--- 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/land/filters.py`
Content:
```
1 from django.utils.translation import ugettext_lazy as _
2 
3 from mapentity.filters import MapEntityFilterSet
4 
5 from geotrek.common.models import Organism
6 from geotrek.common.filters import StructureRelatedFilterSet
7 
8 from geotrek.core.filters import TopologyFilter, PathFilterSet
9 from geotrek.infrastructure.filters import InfrastructureFilterSet, SignageFilterSet
10 from geotrek.maintenance.filters import InterventionFilterSet, ProjectFilterSet
11 from geotrek.trekking.filters import TrekFilterSet, POIFilterSet
12 from geotrek.zoning.filters import *  # NOQA
13 
14 from .models import (
15     CompetenceEdge, LandEdge, LandType, PhysicalEdge, PhysicalType,
16     SignageManagementEdge, WorkManagementEdge,
17 )
18 
19 
20 class PhysicalEdgeFilterSet(MapEntityFilterSet):
21     class Meta:
22         model = PhysicalEdge
23         fields = ['physical_type']
24 
25 
26 class LandEdgeFilterSet(StructureRelatedFilterSet):
27     class Meta:
28         model = LandEdge
29         fields = ['land_type']
30 
31 
32 class OrganismFilterSet(MapEntityFilterSet):
33     class Meta:
34         fields = ['organization']
35 
36 
37 class CompetenceEdgeFilterSet(OrganismFilterSet):
38     class Meta(OrganismFilterSet.Meta):
39         model = CompetenceEdge
40 
41 
42 class WorkManagementEdgeFilterSet(OrganismFilterSet):
43     class Meta(OrganismFilterSet.Meta):
44         model = WorkManagementEdge
45 
46 
47 class SignageManagementEdgeFilterSet(OrganismFilterSet):
48     class Meta(OrganismFilterSet.Meta):
49         model = SignageManagementEdge
50 
51 
52 """
53 
54     Injected filter fields
55 
56 """
57 
58 
59 class TopologyFilterPhysicalType(TopologyFilter):
60     model = PhysicalType
61 
62     def value_to_edges(self, value):
63         return value.physicaledge_set.all()
64 
65 
66 class TopologyFilterLandType(TopologyFilter):
67     model = LandType
68 
69     def value_to_edges(self, value):
70         return value.landedge_set.all()
71 
72 
73 class TopologyFilterCompetenceEdge(TopologyFilter):
74     model = Organism
75 
76     def value_to_edges(self, value):
77         return value.competenceedge_set.select_related('organization').all()
78 
79 
80 class TopologyFilterSignageManagementEdge(TopologyFilter):
81     model = Organism
82 
83     def value_to_edges(self, value):
84         return value.signagemanagementedge_set.select_related('organization').all()
85 
86 
87 class TopologyFilterWorkManagementEdge(TopologyFilter):
88     model = Organism
89 
90     def value_to_edges(self, value):
91         return value.workmanagementedge_set.select_related('organization').all()
92 
93 
94 def add_edge_filters(filter_set):
95     filter_set.add_filters({
96         'physical_type': TopologyFilterPhysicalType(label=_('Physical type'), required=False),
97         'land_type': TopologyFilterLandType(label=_('Land type'), required=False),
98         'competence': TopologyFilterCompetenceEdge(label=_('Competence'), required=False),
99         'signage': TopologyFilterSignageManagementEdge(label=_('Signage management'), required=False),
100         'work': TopologyFilterWorkManagementEdge(label=_('Work management'), required=False),
101     })
102 
103 
104 add_edge_filters(TrekFilterSet)
105 add_edge_filters(POIFilterSet)
106 add_edge_filters(InterventionFilterSet)
107 add_edge_filters(ProjectFilterSet)
108 add_edge_filters(PathFilterSet)
109 add_edge_filters(InfrastructureFilterSet)
110 add_edge_filters(SignageFilterSet)
111
```

Path: `geotrek/zoning/filters.py`
Content:
```
1 from django.utils.translation import ugettext_lazy as _
2 
3 from geotrek.core.filters import TopologyFilter, PathFilterSet
4 from geotrek.infrastructure.filters import InfrastructureFilterSet, SignageFilterSet
5 from geotrek.maintenance.filters import InterventionFilterSet, ProjectFilterSet
6 from geotrek.trekking.filters import TrekFilterSet, POIFilterSet
7 from geotrek.tourism.filters import TouristicContentFilterSet, TouristicEventFilterSet
8 from geotrek.zoning.models import City, District
9 
10 
11 class TopologyFilterCity(TopologyFilter):
12     model = City
13 
14     def value_to_edges(self, value):
15         return value.cityedge_set.all()
16 
17 
18 class TopologyFilterDistrict(TopologyFilter):
19     model = District
20 
21     def value_to_edges(self, value):
22         return value.districtedge_set.all()
23 
24 
25 def add_edge_filters(filter_set):
26     filter_set.add_filters({
27         'city': TopologyFilterCity(label=_('City'), required=False),
28         'district': TopologyFilterDistrict(label=_('District'), required=False),
29     })
30 
31 
32 add_edge_filters(TrekFilterSet)
33 add_edge_filters(POIFilterSet)
34 add_edge_filters(InterventionFilterSet)
35 add_edge_filters(ProjectFilterSet)
36 add_edge_filters(PathFilterSet)
37 add_edge_filters(InfrastructureFilterSet)
38 add_edge_filters(SignageFilterSet)
39 
40 
41 class IntersectionFilter(TopologyFilter):
42     """Inherit from ``TopologyFilter``, just to make sure the widgets
43     will be initialized the same way.
44     """
45     def filter(self, qs, value):
46         if not value:
47             return qs
48         return qs.filter(geom__intersects=value.geom)
49 
50 
51 class IntersectionFilterCity(IntersectionFilter):
52     model = City
53 
54 
55 class IntersectionFilterDistrict(IntersectionFilter):
56     model = District
57 
58 
59 TouristicContentFilterSet.add_filters({
60     'city': IntersectionFilterCity(label=_('City'), required=False),
61     'district': IntersectionFilterDistrict(label=_('District'), required=False),
62 })
63 
64 TouristicEventFilterSet.add_filters({
65     'city': IntersectionFilterCity(label=_('City'), required=False),
66     'district': IntersectionFilterDistrict(label=_('District'), required=False),
67 })
68
```
--- 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/land/filters.py b/geotrek/land/filters.py
--- a/geotrek/land/filters.py
+++ b/geotrek/land/filters.py
@@ -5,7 +5,7 @@
 from geotrek.common.models import Organism
 from geotrek.common.filters import StructureRelatedFilterSet
 
-from geotrek.core.filters import TopologyFilter, PathFilterSet
+from geotrek.core.filters import TopologyFilter, PathFilterSet, TrailFilterSet
 from geotrek.infrastructure.filters import InfrastructureFilterSet, SignageFilterSet
 from geotrek.maintenance.filters import InterventionFilterSet, ProjectFilterSet
 from geotrek.trekking.filters import TrekFilterSet, POIFilterSet
@@ -108,3 +108,4 @@
 add_edge_filters(PathFilterSet)
 add_edge_filters(InfrastructureFilterSet)
 add_edge_filters(SignageFilterSet)
+add_edge_filters(TrailFilterSet)
diff --git a/geotrek/zoning/filters.py b/geotrek/zoning/filters.py
--- a/geotrek/zoning/filters.py
+++ b/geotrek/zoning/filters.py
@@ -1,6 +1,6 @@
 from django.utils.translation import ugettext_lazy as _
 
-from geotrek.core.filters import TopologyFilter, PathFilterSet
+from geotrek.core.filters import TopologyFilter, PathFilterSet, TrailFilterSet
 from geotrek.infrastructure.filters import InfrastructureFilterSet, SignageFilterSet
 from geotrek.maintenance.filters import InterventionFilterSet, ProjectFilterSet
 from geotrek.trekking.filters import TrekFilterSet, POIFilterSet
@@ -36,6 +36,7 @@
 add_edge_filters(PathFilterSet)
 add_edge_filters(InfrastructureFilterSet)
 add_edge_filters(SignageFilterSet)
+add_edge_filters(TrailFilterSet)
 
 
 class IntersectionFilter(TopologyFilter):

{"golden_diff": "diff --git a/geotrek/land/filters.py b/geotrek/land/filters.py\n--- a/geotrek/land/filters.py\n+++ b/geotrek/land/filters.py\n@@ -5,7 +5,7 @@\n from geotrek.common.models import Organism\n from geotrek.common.filters import StructureRelatedFilterSet\n \n-from geotrek.core.filters import TopologyFilter, PathFilterSet\n+from geotrek.core.filters import TopologyFilter, PathFilterSet, TrailFilterSet\n from geotrek.infrastructure.filters import InfrastructureFilterSet, SignageFilterSet\n from geotrek.maintenance.filters import InterventionFilterSet, ProjectFilterSet\n from geotrek.trekking.filters import TrekFilterSet, POIFilterSet\n@@ -108,3 +108,4 @@\n add_edge_filters(PathFilterSet)\n add_edge_filters(InfrastructureFilterSet)\n add_edge_filters(SignageFilterSet)\n+add_edge_filters(TrailFilterSet)\ndiff --git a/geotrek/zoning/filters.py b/geotrek/zoning/filters.py\n--- a/geotrek/zoning/filters.py\n+++ b/geotrek/zoning/filters.py\n@@ -1,6 +1,6 @@\n from django.utils.translation import ugettext_lazy as _\n \n-from geotrek.core.filters import TopologyFilter, PathFilterSet\n+from geotrek.core.filters import TopologyFilter, PathFilterSet, TrailFilterSet\n from geotrek.infrastructure.filters import InfrastructureFilterSet, SignageFilterSet\n from geotrek.maintenance.filters import InterventionFilterSet, ProjectFilterSet\n from geotrek.trekking.filters import TrekFilterSet, POIFilterSet\n@@ -36,6 +36,7 @@\n add_edge_filters(PathFilterSet)\n add_edge_filters(InfrastructureFilterSet)\n add_edge_filters(SignageFilterSet)\n+add_edge_filters(TrailFilterSet)\n \n \n class IntersectionFilter(TopologyFilter):\n", "issue": "TRAIL filters\nAdd \"communes, secteurs, type physique, type foncier...\" for TRAILS filters as it is in other modules.\n\n", "before_files": [{"content": "from django.utils.translation import ugettext_lazy as _\n\nfrom mapentity.filters import MapEntityFilterSet\n\nfrom geotrek.common.models import Organism\nfrom geotrek.common.filters import StructureRelatedFilterSet\n\nfrom geotrek.core.filters import TopologyFilter, PathFilterSet\nfrom geotrek.infrastructure.filters import InfrastructureFilterSet, SignageFilterSet\nfrom geotrek.maintenance.filters import InterventionFilterSet, ProjectFilterSet\nfrom geotrek.trekking.filters import TrekFilterSet, POIFilterSet\nfrom geotrek.zoning.filters import *  # NOQA\n\nfrom .models import (\n    CompetenceEdge, LandEdge, LandType, PhysicalEdge, PhysicalType,\n    SignageManagementEdge, WorkManagementEdge,\n)\n\n\nclass PhysicalEdgeFilterSet(MapEntityFilterSet):\n    class Meta:\n        model = PhysicalEdge\n        fields = ['physical_type']\n\n\nclass LandEdgeFilterSet(StructureRelatedFilterSet):\n    class Meta:\n        model = LandEdge\n        fields = ['land_type']\n\n\nclass OrganismFilterSet(MapEntityFilterSet):\n    class Meta:\n        fields = ['organization']\n\n\nclass CompetenceEdgeFilterSet(OrganismFilterSet):\n    class Meta(OrganismFilterSet.Meta):\n        model = CompetenceEdge\n\n\nclass WorkManagementEdgeFilterSet(OrganismFilterSet):\n    class Meta(OrganismFilterSet.Meta):\n        model = WorkManagementEdge\n\n\nclass SignageManagementEdgeFilterSet(OrganismFilterSet):\n    class Meta(OrganismFilterSet.Meta):\n        model = SignageManagementEdge\n\n\n\"\"\"\n\n    Injected filter fields\n\n\"\"\"\n\n\nclass TopologyFilterPhysicalType(TopologyFilter):\n    model = PhysicalType\n\n    def value_to_edges(self, value):\n        return value.physicaledge_set.all()\n\n\nclass TopologyFilterLandType(TopologyFilter):\n    model = LandType\n\n    def value_to_edges(self, value):\n        return value.landedge_set.all()\n\n\nclass TopologyFilterCompetenceEdge(TopologyFilter):\n    model = Organism\n\n    def value_to_edges(self, value):\n        return value.competenceedge_set.select_related('organization').all()\n\n\nclass TopologyFilterSignageManagementEdge(TopologyFilter):\n    model = Organism\n\n    def value_to_edges(self, value):\n        return value.signagemanagementedge_set.select_related('organization').all()\n\n\nclass TopologyFilterWorkManagementEdge(TopologyFilter):\n    model = Organism\n\n    def value_to_edges(self, value):\n        return value.workmanagementedge_set.select_related('organization').all()\n\n\ndef add_edge_filters(filter_set):\n    filter_set.add_filters({\n        'physical_type': TopologyFilterPhysicalType(label=_('Physical type'), required=False),\n        'land_type': TopologyFilterLandType(label=_('Land type'), required=False),\n        'competence': TopologyFilterCompetenceEdge(label=_('Competence'), required=False),\n        'signage': TopologyFilterSignageManagementEdge(label=_('Signage management'), required=False),\n        'work': TopologyFilterWorkManagementEdge(label=_('Work management'), required=False),\n    })\n\n\nadd_edge_filters(TrekFilterSet)\nadd_edge_filters(POIFilterSet)\nadd_edge_filters(InterventionFilterSet)\nadd_edge_filters(ProjectFilterSet)\nadd_edge_filters(PathFilterSet)\nadd_edge_filters(InfrastructureFilterSet)\nadd_edge_filters(SignageFilterSet)\n", "path": "geotrek/land/filters.py"}, {"content": "from django.utils.translation import ugettext_lazy as _\n\nfrom geotrek.core.filters import TopologyFilter, PathFilterSet\nfrom geotrek.infrastructure.filters import InfrastructureFilterSet, SignageFilterSet\nfrom geotrek.maintenance.filters import InterventionFilterSet, ProjectFilterSet\nfrom geotrek.trekking.filters import TrekFilterSet, POIFilterSet\nfrom geotrek.tourism.filters import TouristicContentFilterSet, TouristicEventFilterSet\nfrom geotrek.zoning.models import City, District\n\n\nclass TopologyFilterCity(TopologyFilter):\n    model = City\n\n    def value_to_edges(self, value):\n        return value.cityedge_set.all()\n\n\nclass TopologyFilterDistrict(TopologyFilter):\n    model = District\n\n    def value_to_edges(self, value):\n        return value.districtedge_set.all()\n\n\ndef add_edge_filters(filter_set):\n    filter_set.add_filters({\n        'city': TopologyFilterCity(label=_('City'), required=False),\n        'district': TopologyFilterDistrict(label=_('District'), required=False),\n    })\n\n\nadd_edge_filters(TrekFilterSet)\nadd_edge_filters(POIFilterSet)\nadd_edge_filters(InterventionFilterSet)\nadd_edge_filters(ProjectFilterSet)\nadd_edge_filters(PathFilterSet)\nadd_edge_filters(InfrastructureFilterSet)\nadd_edge_filters(SignageFilterSet)\n\n\nclass IntersectionFilter(TopologyFilter):\n    \"\"\"Inherit from ``TopologyFilter``, just to make sure the widgets\n    will be initialized the same way.\n    \"\"\"\n    def filter(self, qs, value):\n        if not value:\n            return qs\n        return qs.filter(geom__intersects=value.geom)\n\n\nclass IntersectionFilterCity(IntersectionFilter):\n    model = City\n\n\nclass IntersectionFilterDistrict(IntersectionFilter):\n    model = District\n\n\nTouristicContentFilterSet.add_filters({\n    'city': IntersectionFilterCity(label=_('City'), required=False),\n    'district': IntersectionFilterDistrict(label=_('District'), required=False),\n})\n\nTouristicEventFilterSet.add_filters({\n    'city': IntersectionFilterCity(label=_('City'), required=False),\n    'district': IntersectionFilterDistrict(label=_('District'), required=False),\n})\n", "path": "geotrek/zoning/filters.py"}], "after_files": [{"content": "from django.utils.translation import ugettext_lazy as _\n\nfrom mapentity.filters import MapEntityFilterSet\n\nfrom geotrek.common.models import Organism\nfrom geotrek.common.filters import StructureRelatedFilterSet\n\nfrom geotrek.core.filters import TopologyFilter, PathFilterSet, TrailFilterSet\nfrom geotrek.infrastructure.filters import InfrastructureFilterSet, SignageFilterSet\nfrom geotrek.maintenance.filters import InterventionFilterSet, ProjectFilterSet\nfrom geotrek.trekking.filters import TrekFilterSet, POIFilterSet\nfrom geotrek.zoning.filters import *  # NOQA\n\nfrom .models import (\n    CompetenceEdge, LandEdge, LandType, PhysicalEdge, PhysicalType,\n    SignageManagementEdge, WorkManagementEdge,\n)\n\n\nclass PhysicalEdgeFilterSet(MapEntityFilterSet):\n    class Meta:\n        model = PhysicalEdge\n        fields = ['physical_type']\n\n\nclass LandEdgeFilterSet(StructureRelatedFilterSet):\n    class Meta:\n        model = LandEdge\n        fields = ['land_type']\n\n\nclass OrganismFilterSet(MapEntityFilterSet):\n    class Meta:\n        fields = ['organization']\n\n\nclass CompetenceEdgeFilterSet(OrganismFilterSet):\n    class Meta(OrganismFilterSet.Meta):\n        model = CompetenceEdge\n\n\nclass WorkManagementEdgeFilterSet(OrganismFilterSet):\n    class Meta(OrganismFilterSet.Meta):\n        model = WorkManagementEdge\n\n\nclass SignageManagementEdgeFilterSet(OrganismFilterSet):\n    class Meta(OrganismFilterSet.Meta):\n        model = SignageManagementEdge\n\n\n\"\"\"\n\n    Injected filter fields\n\n\"\"\"\n\n\nclass TopologyFilterPhysicalType(TopologyFilter):\n    model = PhysicalType\n\n    def value_to_edges(self, value):\n        return value.physicaledge_set.all()\n\n\nclass TopologyFilterLandType(TopologyFilter):\n    model = LandType\n\n    def value_to_edges(self, value):\n        return value.landedge_set.all()\n\n\nclass TopologyFilterCompetenceEdge(TopologyFilter):\n    model = Organism\n\n    def value_to_edges(self, value):\n        return value.competenceedge_set.select_related('organization').all()\n\n\nclass TopologyFilterSignageManagementEdge(TopologyFilter):\n    model = Organism\n\n    def value_to_edges(self, value):\n        return value.signagemanagementedge_set.select_related('organization').all()\n\n\nclass TopologyFilterWorkManagementEdge(TopologyFilter):\n    model = Organism\n\n    def value_to_edges(self, value):\n        return value.workmanagementedge_set.select_related('organization').all()\n\n\ndef add_edge_filters(filter_set):\n    filter_set.add_filters({\n        'physical_type': TopologyFilterPhysicalType(label=_('Physical type'), required=False),\n        'land_type': TopologyFilterLandType(label=_('Land type'), required=False),\n        'competence': TopologyFilterCompetenceEdge(label=_('Competence'), required=False),\n        'signage': TopologyFilterSignageManagementEdge(label=_('Signage management'), required=False),\n        'work': TopologyFilterWorkManagementEdge(label=_('Work management'), required=False),\n    })\n\n\nadd_edge_filters(TrekFilterSet)\nadd_edge_filters(POIFilterSet)\nadd_edge_filters(InterventionFilterSet)\nadd_edge_filters(ProjectFilterSet)\nadd_edge_filters(PathFilterSet)\nadd_edge_filters(InfrastructureFilterSet)\nadd_edge_filters(SignageFilterSet)\nadd_edge_filters(TrailFilterSet)\n", "path": "geotrek/land/filters.py"}, {"content": "from django.utils.translation import ugettext_lazy as _\n\nfrom geotrek.core.filters import TopologyFilter, PathFilterSet, TrailFilterSet\nfrom geotrek.infrastructure.filters import InfrastructureFilterSet, SignageFilterSet\nfrom geotrek.maintenance.filters import InterventionFilterSet, ProjectFilterSet\nfrom geotrek.trekking.filters import TrekFilterSet, POIFilterSet\nfrom geotrek.tourism.filters import TouristicContentFilterSet, TouristicEventFilterSet\nfrom geotrek.zoning.models import City, District\n\n\nclass TopologyFilterCity(TopologyFilter):\n    model = City\n\n    def value_to_edges(self, value):\n        return value.cityedge_set.all()\n\n\nclass TopologyFilterDistrict(TopologyFilter):\n    model = District\n\n    def value_to_edges(self, value):\n        return value.districtedge_set.all()\n\n\ndef add_edge_filters(filter_set):\n    filter_set.add_filters({\n        'city': TopologyFilterCity(label=_('City'), required=False),\n        'district': TopologyFilterDistrict(label=_('District'), required=False),\n    })\n\n\nadd_edge_filters(TrekFilterSet)\nadd_edge_filters(POIFilterSet)\nadd_edge_filters(InterventionFilterSet)\nadd_edge_filters(ProjectFilterSet)\nadd_edge_filters(PathFilterSet)\nadd_edge_filters(InfrastructureFilterSet)\nadd_edge_filters(SignageFilterSet)\nadd_edge_filters(TrailFilterSet)\n\n\nclass IntersectionFilter(TopologyFilter):\n    \"\"\"Inherit from ``TopologyFilter``, just to make sure the widgets\n    will be initialized the same way.\n    \"\"\"\n    def filter(self, qs, value):\n        if not value:\n            return qs\n        return qs.filter(geom__intersects=value.geom)\n\n\nclass IntersectionFilterCity(IntersectionFilter):\n    model = City\n\n\nclass IntersectionFilterDistrict(IntersectionFilter):\n    model = District\n\n\nTouristicContentFilterSet.add_filters({\n    'city': IntersectionFilterCity(label=_('City'), required=False),\n    'district': IntersectionFilterDistrict(label=_('District'), required=False),\n})\n\nTouristicEventFilterSet.add_filters({\n    'city': IntersectionFilterCity(label=_('City'), required=False),\n    'district': IntersectionFilterDistrict(label=_('District'), required=False),\n})\n", "path": "geotrek/zoning/filters.py"}]}