Merge branch 'feature/migrate-city-objects' of ssh://gl.id-east.ru:222/gm/gm-backend into feature/migrate-city-objects
Conflicts: apps/location/transfer.py
This commit is contained in:
commit
e2a991df98
|
|
@ -1,29 +1,25 @@
|
|||
Country = {
|
||||
"dependencies": None,
|
||||
"legacy": "Cities",
|
||||
"fields": {
|
||||
"code": "country_code_2"
|
||||
}
|
||||
}
|
||||
"""
|
||||
Структура fields:
|
||||
key - поле в таблице postgres
|
||||
value - поле или группа полей в таблице legacy
|
||||
|
||||
Region = {
|
||||
"dependencies": ["Country", "self"],
|
||||
"legacy": "Cities",
|
||||
"fields": {
|
||||
"code": "region_code",
|
||||
"country": "Country",
|
||||
"parent_region": "self",
|
||||
}
|
||||
}
|
||||
В случае передачи группы полей каждое поле представляет собой кортеж, где:
|
||||
field[0] - название аргумента
|
||||
field[1] - название поля в таблице legacy
|
||||
Опционально: field[2] - тип данных для преобразования
|
||||
|
||||
"""
|
||||
|
||||
City = {
|
||||
"dependencies": ["Country", "Region"],
|
||||
"legacy": "Cities",
|
||||
"dependencies": ("Country", "Region"),
|
||||
"fields": {
|
||||
"name": "name",
|
||||
"region": "Region",
|
||||
"country": "Country",
|
||||
"postal_code": "zip_code",
|
||||
"is_island": "is_island",
|
||||
"Cities": {
|
||||
"coordinates": (("lat", "latitude", "Boolean"), ("long", "longtitude")),
|
||||
"code": "country_code_2"
|
||||
},
|
||||
"CityNames": {
|
||||
"name": "name",
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user