tcl: adapt to updated attributes in line data sources (#71509)
This commit is contained in:
parent
56b6baea78
commit
9b889430d1
|
@ -131,6 +131,10 @@ class Tcl(BaseResource):
|
|||
response = self.requests.get(url)
|
||||
response.raise_for_status()
|
||||
for line_data in response.json()['values']:
|
||||
if 'code_trace' in line_data:
|
||||
line_data['code_titan'] = line_data['code_trace']
|
||||
if 'nom_trace' in line_data:
|
||||
line_data['libelle'] = line_data['nom_trace']
|
||||
line, dummy = Line.objects.get_or_create(
|
||||
code_titan=line_data['code_titan'],
|
||||
defaults={'transport_key': key, 'ligne': line_data['ligne']},
|
||||
|
|
|
@ -10,16 +10,12 @@ from passerelle.contrib.tcl.models import Line, Stop, Tcl
|
|||
LIGNE_BUS = {
|
||||
"values": [
|
||||
{
|
||||
"indice": "",
|
||||
"last_update_fme": "2017-06-27 06:01:10",
|
||||
"infos": "",
|
||||
"couleur": "164 203 38",
|
||||
"libelle": "Croix Rousse - Plateaux de St Rambert",
|
||||
"nom_trace": "Croix Rousse - Plateaux de St Rambert",
|
||||
"last_update": "None",
|
||||
"code_titan": "2Aa1",
|
||||
"code_trace": "2Aa1",
|
||||
"gid": "1003",
|
||||
"ligne": "2",
|
||||
"ut": "UTV",
|
||||
"sens": "Aller",
|
||||
},
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue