Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aggregator parser #3196

Merged
merged 117 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
8c33660
Change name option filename
LePetitTim Jul 28, 2022
59f91c5
Improve actual parsers with mapping
LePetitTim Jul 28, 2022
2b5c257
Add GeotrekParser
LePetitTim Jul 28, 2022
e722170
Add parser tourism from api v2
LePetitTim Jul 28, 2022
c22e556
Add parser api v2 Geotrek Trekking
LePetitTim Jul 28, 2022
f25346c
Add parsers infrastructure signage Api v2
LePetitTim Jul 28, 2022
303d6ae
Fix test task raise message
LePetitTim Jul 28, 2022
e933726
Improve attachment parser, separate save_attachments
LePetitTim Jul 28, 2022
3a7299c
Change categories integration datas
LePetitTim Jul 29, 2022
4f877b9
Add test GeotrekTrekParser
LePetitTim Jul 29, 2022
382acb9
Add POI test parser
LePetitTim Jul 29, 2022
6e91b98
Add test files parser trek poi
LePetitTim Jul 29, 2022
170886d
Add test service parser api v2
LePetitTim Jul 29, 2022
0f833d8
Add tests tourism parser geotrek api v2
LePetitTim Jul 29, 2022
4508d28
Fix url foo parsers
LePetitTim Jul 29, 2022
9589ad0
Fix parser common/infrastructure/signage, add tests signage/ infrastr…
LePetitTim Aug 1, 2022
2bb5988
Add geom required in parsers
LePetitTim Aug 1, 2022
4aa97c4
Fix linting
LePetitTim Aug 1, 2022
9538c4b
Add tests geom parsers api v2
LePetitTim Aug 1, 2022
e914fcc
Change mock response requests get information desk
LePetitTim Aug 1, 2022
a6dacf7
Add children parser api v2
LePetitTim Aug 1, 2022
8d7df49
Add children file trek
LePetitTim Aug 2, 2022
6a849c3
Add filter uuid information desk
LePetitTim Aug 2, 2022
51d27e9
Add test no content attachment download
LePetitTim Aug 2, 2022
023d8f4
Update test informaiton desk
LePetitTim Aug 2, 2022
53dde7e
Add tests mapping
LePetitTim Aug 2, 2022
ab63c00
Add help filename import command
LePetitTim Aug 2, 2022
bfedea3
Add tests parsers
LePetitTim Aug 2, 2022
c0cc905
Improve helper command import filename
LePetitTim Aug 3, 2022
2c251f0
Add Docstring, comment on GeotrekParser
LePetitTim Aug 3, 2022
f9528ff
Add label on Trekking parser api v2
LePetitTim Aug 3, 2022
4cf0842
Add light documentation
Aug 4, 2022
ffaef8a
Add warning about dynamic segmentation
Aug 4, 2022
5b2b425
Add test different eid, fix multiple same parser
LePetitTim Aug 4, 2022
54b9896
Use id as eid for parser
LePetitTim Aug 4, 2022
3f15d6e
Add exception message in children generation
LePetitTim Aug 4, 2022
3a8e2b0
Remove rowimporterror
LePetitTim Aug 4, 2022
53096b6
Add wrong children test
LePetitTim Aug 4, 2022
16431fe
Add warnings, addportal_filter, url on general parser
LePetitTim Aug 4, 2022
ef7f2a1
Improve warning use name for generation of children
LePetitTim Aug 4, 2022
a9ba8b1
Add some docstring
Aug 4, 2022
90cfda6
Add aggregator parser
LePetitTim Aug 5, 2022
2d6fdfa
Add Signage Infrastructure Parser
LePetitTim Aug 5, 2022
795d0ec
Add license trek
LePetitTim Aug 5, 2022
0d93cf9
Add test erro children trek api parser v2
LePetitTim Aug 5, 2022
96be0b2
Add create categories, add mapping tourism
LePetitTim Aug 5, 2022
c422957
Fix linting init geotrekparser
LePetitTim Aug 7, 2022
1c1aace
Fix tests with ids for deletion parser api v2
LePetitTim Aug 7, 2022
b7260c3
Fix test repr not always the same
LePetitTim Aug 7, 2022
e7a161a
Add warning with dynamic segmenation model not possible to import
LePetitTim Aug 8, 2022
380e7a3
Avoid error request without results key in json
LePetitTim Aug 8, 2022
bf6f026
Add file test config aggregator with dynamic segmentation
LePetitTim Aug 8, 2022
79b7ed0
Add test aggregator parser
LePetitTim Aug 8, 2022
23ce775
Fix warning parser, add skipif add test no url
LePetitTim Aug 8, 2022
8a998a0
Add config aggregator no url file
LePetitTim Aug 8, 2022
ceae3ee
Fix test render to string
LePetitTim Aug 8, 2022
9644fba
Add language geotrek parser
LePetitTim Aug 8, 2022
cd3fb8b
Fix update deletion was not working, add test
LePetitTim Aug 8, 2022
aabd34d
Remove uuid filter
LePetitTim Aug 8, 2022
db516ba
Add file trek ids 2
LePetitTim Aug 8, 2022
dc3fb30
Add test attachments tourism
LePetitTim Aug 8, 2022
609e3f4
Add progress aggregator parser
LePetitTim Aug 8, 2022
ff866ad
Add test with aggregator working
LePetitTim Aug 8, 2022
daa5f85
Fix import json
LePetitTim Aug 8, 2022
f4d998a
Fix updated after
LePetitTim Aug 9, 2022
de53f94
Chane information filename parse AggregateParser, data_to_import all …
LePetitTim Aug 9, 2022
4d60f57
Remove to_delete no kwargs GeotrekAggregator
LePetitTim Aug 9, 2022
f2ad0db
Fix params GeotrekParser
LePetitTim Aug 9, 2022
eefdd3d
Add test no file no_data_to_import
LePetitTim Aug 9, 2022
63dd1b5
Add tests aggregator parser
LePetitTim Aug 9, 2022
0add73a
Add all_datas option
LePetitTim Aug 9, 2022
2fd5e17
Fix types TouristicContent Parser Aggregator
LePetitTim Aug 9, 2022
9ea8418
Fix multiple page params was used every pages
LePetitTim Aug 9, 2022
bee33fc
Fix test multiple page
LePetitTim Aug 10, 2022
fb02093
Add changelog
LePetitTim Aug 10, 2022
8356ccf
Add requests.exceptions.ConnectionError on exception attachment parser
LePetitTim Aug 10, 2022
e1e23ca
Add tests connectionerror
LePetitTim Aug 10, 2022
0501e4b
Improve test parser geotrek with mixin
LePetitTim Aug 12, 2022
5bcbe58
Fix linting import os json classmethod
LePetitTim Aug 29, 2022
b266047
Add 'provider' field to Trek, POI, Service
Chatewgne Sep 7, 2022
3703e76
Add 'provider' field to Infrastructure, Signage
Chatewgne Sep 7, 2022
ca0d0b9
Add 'provider' field to TouristicContent, TouristicEvent, Information…
Chatewgne Sep 7, 2022
351155b
Enable filtering by provider
Chatewgne Sep 7, 2022
530ec9c
Fix filtering on Services does not work
Chatewgne Sep 8, 2022
887e5e4
Fix migration errors
Chatewgne Sep 8, 2022
dd8e36f
Add 'provider' to APIv2
Chatewgne Sep 8, 2022
bb24e93
Fix tests
Chatewgne Sep 9, 2022
cf7dc9b
Enable parsing by provider and add tests
Chatewgne Sep 9, 2022
317dcbb
Remove comments
Chatewgne Sep 9, 2022
d48d220
Codestyle
Chatewgne Sep 9, 2022
7a503fc
Add missing test data file
Chatewgne Sep 9, 2022
91ab39b
Fix tests
Chatewgne Sep 9, 2022
9cada5e
Fix tests
Chatewgne Sep 9, 2022
a7b3ec0
Set UUIDs of aggregated objects to both EID and UUID in database
Chatewgne Sep 9, 2022
09e310d
Fix changelog
Chatewgne Sep 9, 2022
cff574f
Add 'provider' field to Path, Trail
Chatewgne Sep 9, 2022
e3eee3e
Add 'provider' field to Site, Course
Chatewgne Sep 9, 2022
785d7d8
Add 'provider' field to SensitiveArea
Chatewgne Sep 9, 2022
9dd24f2
Fix typo in serializer
Chatewgne Sep 9, 2022
a3b725a
Fix use uuid as id in parsers
Chatewgne Sep 9, 2022
07b2cae
Fix use uuid as id in parsers tests
Chatewgne Sep 9, 2022
e64c383
Fix use uuid as id in Trek parsers
Chatewgne Sep 12, 2022
68192aa
Change empty provider behaviour in parser
Chatewgne Sep 12, 2022
21796fe
Codestyle
Chatewgne Sep 12, 2022
9c3e4f8
Remove print
Chatewgne Sep 13, 2022
a369191
Add end of files newlines
Chatewgne Sep 14, 2022
b16af28
Replace 'eid_prefix' with 'provider' in GeotrekParser
Chatewgne Sep 15, 2022
2ef70b5
Improve error message in Tour parsing
Chatewgne Sep 15, 2022
9a6058d
Add missing provider filters
Chatewgne Sep 16, 2022
84d8af6
Add db index on providers
Chatewgne Sep 16, 2022
9be7899
Fix Outdoor Managers
Chatewgne Sep 16, 2022
45e4f9a
Fix tests with new queries
Chatewgne Sep 16, 2022
3684194
Start documenting Parser attributes
Chatewgne Sep 16, 2022
0ac86f1
Alter proper table in SQL templates for Signage
Chatewgne Sep 19, 2022
c92eec9
Fix test should not depend on list order
Chatewgne Sep 19, 2022
19f6b09
Merge pull request #3226 from GeotrekCE/delete_by_provider
Chatewgne Sep 19, 2022
b72044e
Add warning and test for missing Tour parent trek
Chatewgne Sep 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ CHANGELOG
2.86.0+dev (XXXX-XX-XX)
-----------------------

**New features**

- Add `provider` field to Trek, POI, Service, Signage, Infrastructure, TouristicContent, TouristicEvent, InformationDesk,
Path, Trail, Course, Site, SensitiveArea (#3189)
- Add parser using api v2 (InformationDesk, TouristicContent, TouristicEvent, POI, Trek, Service, Signage, Infrastructure)
- Add aggregator parser with a conductor using json file

**Bug fixes**

- Fix filtering on Services List does not filter

**Minor improvements**

- Disable debug log in debian package post installation script.
Expand Down
17 changes: 17 additions & 0 deletions docs/install/advanced-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1701,6 +1701,7 @@ A (nearly?) exhaustive list of attributes available for display and export as co
"min_elevation",
"max_elevation",
"uuid",
"provider"
]
COLUMNS_LISTS["workmanagementedge_export"] = [
"eid",
Expand All @@ -1726,6 +1727,8 @@ A (nearly?) exhaustive list of attributes available for display and export as co
"maintenance_difficulty",
"published",
"uuid",
"eid",
"provider"
]
COLUMNS_LISTS["signage_view"] = [
"code",
Expand Down Expand Up @@ -1818,6 +1821,9 @@ A (nearly?) exhaustive list of attributes available for display and export as co
"reservation_id",
"portal",
"uuid",
"eid",
"eid2",
"provider"
]
COLUMNS_LISTS["poi_view"] = [
"structure",
Expand Down Expand Up @@ -1875,6 +1881,8 @@ A (nearly?) exhaustive list of attributes available for display and export as co
"date_update",
"date_insert",
"uuid",
"eid",
"provider"
]
COLUMNS_LISTS["touristic_event_view"] = [
"structure",
Expand Down Expand Up @@ -1902,6 +1910,8 @@ A (nearly?) exhaustive list of attributes available for display and export as co
"date_update",
"date_insert",
"uuid",
"eid",
"provider"
]
COLUMNS_LISTS["feedback_view"] = [
"email",
Expand Down Expand Up @@ -2147,6 +2157,8 @@ A (nearly?) exhaustive list of attributes available for display and export as co
"usage_difficulty",
"maintenance_difficulty"
"uuid",
"eid",
"provider"
]
COLUMNS_LISTS["signage_export"] = [
"structure",
Expand All @@ -2173,6 +2185,8 @@ A (nearly?) exhaustive list of attributes available for display and export as co
"min_elevation",
"max_elevation",
"uuid",
"eid",
"provider"
]
COLUMNS_LISTS["intervention_export"] = [
"name",
Expand Down Expand Up @@ -2289,6 +2303,7 @@ A (nearly?) exhaustive list of attributes available for display and export as co
"max_elevation",
"slope",
"uuid",
"provider"
]
COLUMNS_LISTS["poi_export"] = [
"structure",
Expand Down Expand Up @@ -2376,6 +2391,7 @@ A (nearly?) exhaustive list of attributes available for display and export as co
"areas",
"approved",
"uuid",
"provider"
]
COLUMNS_LISTS["touristic_event_export"] = [
"structure",
Expand Down Expand Up @@ -2412,6 +2428,7 @@ A (nearly?) exhaustive list of attributes available for display and export as co
"areas",
"approved",
"uuid",
"provider"
]
COLUMNS_LISTS["feedback_export"] = [
"email",
Expand Down
39 changes: 39 additions & 0 deletions docs/install/import.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,45 @@ Start import from Geotrek-admin UI
Open the top right menu and clic on ``imports``.


Import data from a remote Geotrek instance
==========================================

Importing from a Geotrek instance works the same way as from SIT.
A usecase for this is to aggregate data from several Geotrek-admin instance.

.. danger::
Importing data from a remote Geotrek instance does not work with dynamic segmentation, your instance where you import data
must have dynamic segmentation disabled.


For example, to import treks from another instance,
edit ``/opt/geotrek-admin/var/conf/parsers.py`` file with the following content:

::

class DemoGeotrekTrekParser(BaseGeotrekTrekParser):
url = "https://remote-geotrek-admin.net" # replace url with remote instance url
delete = False
field_options = {
'difficulty': {'create': True, },
'route': {'create': True, },
'themes': {'create': True},
'practice': {'create': True},
'accessibilities': {'create': True},
'networks': {'create': True},
'geom': {'required': True},
'labels': {'create': True},
}

Then run in command line

::

sudo geotrek import DemoGeotrekTrekParser

Treks are now imported into your own instance.


Import data from a file
=======================

Expand Down
24 changes: 12 additions & 12 deletions geotrek/api/tests/test_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,18 @@
'external_id', 'gpx', 'information_desks', 'kml', 'labels', 'length_2d',
'length_3d', 'max_elevation', 'min_elevation', 'name', 'networks',
'next', 'parents', 'parking_location', 'pdf', 'points_reference',
'portal', 'practice', 'previous', 'public_transport', 'published', 'ratings', 'ratings_description',
'portal', 'practice', 'previous', 'public_transport', 'provider', 'published', 'ratings', 'ratings_description',
'reservation_system', 'reservation_id', 'route', 'second_external_id', 'source', 'structure',
'themes', 'update_datetime', 'url', 'uuid', 'web_links'
])

PATH_PROPERTIES_GEOJSON_STRUCTURE = sorted(['comments', 'length_2d', 'length_3d', 'name', 'url', 'uuid'])
PATH_PROPERTIES_GEOJSON_STRUCTURE = sorted(['comments', 'length_2d', 'length_3d', 'name', 'provider', 'url', 'uuid'])

TOUR_PROPERTIES_GEOJSON_STRUCTURE = sorted(TREK_PROPERTIES_GEOJSON_STRUCTURE + ['count_children', 'steps'])

POI_PROPERTIES_GEOJSON_STRUCTURE = sorted([
'id', 'create_datetime', 'description', 'external_id',
'name', 'attachments', 'published', 'type', 'type_label', 'type_pictogram',
'name', 'attachments', 'published', 'provider', 'type', 'type_label', 'type_pictogram',
'update_datetime', 'url', 'uuid'
])

Expand All @@ -92,7 +92,7 @@
TOURISTIC_CONTENT_DETAIL_JSON_STRUCTURE = sorted([
'accessibility', 'approved', 'attachments', 'category', 'cities', 'contact', 'create_datetime', 'description',
'description_teaser', 'departure_city', 'email', 'external_id', 'geometry', 'id', 'label_accessibility', 'name', 'pdf',
'portal', 'practical_info', 'published', 'reservation_id', 'reservation_system',
'portal', 'practical_info', 'provider', 'published', 'reservation_id', 'reservation_system',
'source', 'structure', 'themes', 'types', 'update_datetime', 'url', 'uuid', 'website',
])

Expand Down Expand Up @@ -136,7 +136,7 @@

INFORMATION_DESK_PROPERTIES_JSON_STRUCTURE = sorted([
'id', 'accessibility', 'description', 'email', 'label_accessibility', 'latitude', 'longitude',
'municipality', 'name', 'phone', 'photo_url', 'uuid',
'municipality', 'name', 'phone', 'photo_url', 'provider', 'uuid',
'postal_code', 'street', 'type', 'website'
])

Expand All @@ -147,7 +147,7 @@
SITE_PROPERTIES_JSON_STRUCTURE = sorted([
'accessibility', 'advice', 'ambiance', 'attachments', 'children', 'cities', 'courses', 'description', 'description_teaser', 'eid',
'geometry', 'id', 'information_desks', 'labels', 'managers', 'name', 'orientation', 'parent', 'period', 'portal',
'practice', 'pdf', 'ratings', 'sector', 'source', 'structure', 'themes', 'type', 'url', 'uuid', 'wind', 'web_links',
'practice', 'provider', 'pdf', 'ratings', 'sector', 'source', 'structure', 'themes', 'type', 'url', 'uuid', 'wind', 'web_links',
])

OUTDOORPRACTICE_PROPERTIES_JSON_STRUCTURE = sorted(['id', 'name', 'sector', 'pictogram'])
Expand All @@ -158,7 +158,7 @@

SENSITIVE_AREA_PROPERTIES_JSON_STRUCTURE = sorted([
'id', 'contact', 'create_datetime', 'description', 'elevation', 'geometry',
'info_url', 'kml_url', 'name', 'period', 'practices', 'published', 'species_id',
'info_url', 'kml_url', 'name', 'period', 'practices', 'provider', 'published', 'species_id',
'structure', 'update_datetime', 'url'
])

Expand All @@ -172,7 +172,7 @@
COURSE_PROPERTIES_JSON_STRUCTURE = sorted([
'accessibility', 'advice', 'cities', 'description', 'eid', 'equipment', 'geometry', 'height', 'id',
'length', 'name', 'ratings', 'ratings_description', 'sites', 'structure',
'type', 'url', 'attachments', 'max_elevation', 'min_elevation', 'parents',
'type', 'url', 'attachments', 'max_elevation', 'min_elevation', 'parents', 'provider',
'pdf', 'points_reference', 'children', 'duration', 'gear', 'uuid'
])

Expand All @@ -181,7 +181,7 @@
ORGANISM_PROPERTIES_JSON_STRUCTURE = sorted(['id', 'name'])

SERVICE_DETAIL_JSON_STRUCTURE = sorted([
'id', 'eid', 'geometry', 'structure', 'type', 'uuid'
'id', 'eid', 'geometry', 'provider', 'structure', 'type', 'uuid'
])

SERVICE_TYPE_DETAIL_JSON_STRUCTURE = sorted([
Expand All @@ -190,7 +190,7 @@

INFRASTRUCTURE_DETAIL_JSON_STRUCTURE = sorted([
'id', 'accessibility', 'attachments', 'condition', 'description', 'eid', 'geometry',
'implantation_year', 'maintenance_difficulty', 'name', 'structure',
'implantation_year', 'maintenance_difficulty', 'name', 'provider', 'structure',
'type', 'usage_difficulty', 'uuid'
])

Expand All @@ -214,7 +214,7 @@
'id', 'accessibility', 'approved', 'attachments', 'begin_date', 'booking', 'cities', 'contact', 'create_datetime',
'description', 'description_teaser', 'duration', 'email', 'end_date', 'external_id', 'geometry',
'meeting_point', 'meeting_time', 'name', 'organizer', 'participant_number', 'pdf', 'portal',
'practical_info', 'published', 'source', 'speaker', 'structure', 'target_audience', 'themes',
'practical_info', 'provider', 'published', 'source', 'speaker', 'structure', 'target_audience', 'themes',
'type', 'update_datetime', 'url', 'uuid', 'website'
])

Expand All @@ -225,7 +225,7 @@
SIGNAGE_DETAIL_JSON_STRUCTURE = sorted([
'id', 'attachments', 'blades', 'code', 'condition', 'description', 'eid',
'geometry', 'implantation_year', 'name', 'printed_elevation', 'sealing',
'structure', 'type', 'uuid'
'provider', 'structure', 'type', 'uuid'
])

SIGNAGE_TYPE_DETAIL_JSON_STRUCTURE = sorted([
Expand Down
26 changes: 13 additions & 13 deletions geotrek/api/v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class ServiceSerializer(DynamicFieldsMixin, serializers.ModelSerializer):

class Meta:
model = trekking_models.Service
fields = ('id', 'eid', 'geometry', 'structure', 'type', 'uuid')
fields = ('id', 'eid', 'geometry', 'provider', 'structure', 'type', 'uuid')


class ReservationSystemSerializer(DynamicFieldsMixin, serializers.ModelSerializer):
Expand Down Expand Up @@ -424,7 +424,7 @@ class Meta:
'id', 'accessibility', 'attachments', 'approved', 'category', 'description',
'description_teaser', 'departure_city', 'geometry', 'label_accessibility',
'practical_info', 'url', 'cities', 'create_datetime',
'external_id', 'name', 'pdf', 'portal', 'published',
'external_id', 'name', 'pdf', 'portal', 'provider', 'published',
'source', 'structure', 'themes',
'update_datetime', 'types', 'contact', 'email',
'website', 'reservation_system', 'reservation_id', 'uuid'
Expand Down Expand Up @@ -461,7 +461,7 @@ class Meta:
'cities', 'contact', 'create_datetime', 'description', 'description_teaser',
'duration', 'email', 'end_date', 'external_id', 'geometry', 'meeting_point',
'meeting_time', 'name', 'organizer', 'participant_number', 'pdf', 'portal',
'practical_info', 'published', 'source', 'speaker', 'structure',
'practical_info', 'published', 'provider', 'source', 'speaker', 'structure',
'target_audience', 'themes', 'type', 'update_datetime', 'url', 'uuid', 'website'
)

Expand Down Expand Up @@ -500,7 +500,7 @@ class Meta:
fields = (
'id', 'accessibility', 'description', 'email', 'label_accessibility', 'latitude', 'longitude',
'municipality', 'name', 'phone', 'photo_url', 'uuid',
'postal_code', 'street', 'type', 'website'
'postal_code', 'provider', 'street', 'type', 'website'
)


Expand All @@ -518,7 +518,7 @@ class Meta:
model = core_models.Path
fields = (
'id', 'comments', 'geometry', 'length_2d', 'length_3d',
'name', 'url', 'uuid'
'name', 'provider', 'url', 'uuid'
)


Expand Down Expand Up @@ -699,7 +699,7 @@ class Meta:
'information_desks', 'kml', 'labels', 'length_2d', 'length_3d',
'max_elevation', 'min_elevation', 'name', 'networks', 'next',
'parents', 'parking_location', 'pdf', 'points_reference',
'portal', 'practice', 'ratings', 'ratings_description', 'previous', 'public_transport',
'portal', 'practice', 'provider', 'ratings', 'ratings_description', 'previous', 'public_transport',
'published', 'reservation_system', 'reservation_id', 'route', 'second_external_id',
'source', 'structure', 'themes', 'update_datetime', 'url', 'uuid', 'web_links'
)
Expand Down Expand Up @@ -764,9 +764,9 @@ class Meta:
model = trekking_models.POI
fields = (
'id', 'description', 'external_id',
'geometry', 'name', 'attachments', 'published', 'type',
'geometry', 'name', 'attachments', 'provider', 'published', 'type',
'type_label', 'type_pictogram', 'url', 'uuid',
'create_datetime', 'update_datetime',
'create_datetime', 'update_datetime'
)

class ThemeSerializer(DynamicFieldsMixin, serializers.ModelSerializer):
Expand Down Expand Up @@ -845,7 +845,7 @@ class Meta:
fields = (
'id', 'contact', 'create_datetime', 'description', 'elevation',
'geometry', 'info_url', 'kml_url', 'name', 'period',
'practices', 'published', 'species_id', 'structure',
'practices', 'published', 'species_id', 'provider', 'structure',
'update_datetime', 'url'
)

Expand Down Expand Up @@ -1055,7 +1055,7 @@ class Meta:
fields = (
'id', 'accessibility', 'advice', 'ambiance', 'attachments', 'cities', 'children', 'description',
'description_teaser', 'eid', 'geometry', 'information_desks', 'labels', 'managers',
'name', 'orientation', 'pdf', 'period', 'parent', 'portal', 'practice',
'name', 'orientation', 'pdf', 'period', 'parent', 'portal', 'practice', 'provider',
'ratings', 'sector', 'source', 'structure', 'themes',
'type', 'url', 'uuid', 'courses', 'web_links', 'wind',
)
Expand Down Expand Up @@ -1115,7 +1115,7 @@ class Meta:
fields = (
'id', 'accessibility', 'advice', 'attachments', 'children', 'cities', 'description', 'duration', 'eid',
'equipment', 'gear', 'geometry', 'height', 'length', 'max_elevation',
'min_elevation', 'name', 'parents', 'pdf', 'points_reference', 'ratings', 'ratings_description',
'min_elevation', 'name', 'parents', 'pdf', 'points_reference', 'provider', 'ratings', 'ratings_description',
'sites', 'structure', 'type', 'url', 'uuid'
)

Expand Down Expand Up @@ -1209,7 +1209,7 @@ def get_accessibility(self, obj):
class Meta:
model = infrastructure_models.Infrastructure
fields = ('id', 'accessibility', 'attachments', 'condition', 'description', 'eid', 'geometry', 'name',
'implantation_year', 'maintenance_difficulty', 'structure', 'type', 'usage_difficulty', 'uuid')
'implantation_year', 'maintenance_difficulty', 'provider', 'structure', 'type', 'usage_difficulty', 'uuid')

class InfrastructureConditionSerializer(DynamicFieldsMixin, serializers.ModelSerializer):

Expand Down Expand Up @@ -1254,7 +1254,7 @@ class SignageSerializer(DynamicFieldsMixin, serializers.ModelSerializer):
class Meta:
model = signage_models.Signage
fields = ('id', 'attachments', 'blades', 'code', 'condition', 'description', 'eid',
'geometry', 'implantation_year', 'name', 'printed_elevation', 'sealing',
'geometry', 'implantation_year', 'name', 'printed_elevation', 'provider', 'sealing',
'structure', 'type', 'uuid')

class SignageTypeSerializer(DynamicFieldsMixin, serializers.ModelSerializer):
Expand Down
6 changes: 3 additions & 3 deletions geotrek/common/management/commands/import.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Command(BaseCommand):

def add_arguments(self, parser):
parser.add_argument('parser', help='Parser class name in var/conf/parsers.py (or dotted syntax in python path)')
parser.add_argument('shapefile', nargs="?")
parser.add_argument('filename', nargs="?", help='Optional file used to feed database')
parser.add_argument('-l', dest='limit', type=int, help='Limit number of lines to import')
parser.add_argument('--encoding', '-e', default='utf8')

Expand Down Expand Up @@ -41,7 +41,7 @@ def handle(self, *args, **options):
Parser = getattr(module, class_name)
except AttributeError:
raise CommandError("Failed to import parser class '{0}'".format(class_name))
if not Parser.filename and not Parser.url and not options['shapefile']:
if not Parser.filename and not Parser.url and not options['filename']:
raise CommandError("File path missing")

def progress_cb(progress, line, eid):
Expand All @@ -52,7 +52,7 @@ def progress_cb(progress, line, eid):
parser = Parser(progress_cb=progress_cb, encoding=encoding)

try:
parser.parse(options['shapefile'], limit=limit)
parser.parse(options['filename'], limit=limit)
except ImportError as e:
raise CommandError(e)

Expand Down
Loading