from PySide.QtCore import Qt
from PySide.QtDeclarative import QDeclarativeView
-def QMLModel(overview):
+def QMLModel(overview, details):
# Mapping from the "overview" data structure to a "plain" data
# structure to be used as model for the qml listview
r = []
+ i = 0
for item in overview:
d = {
'date': item['date'].strftime('%d.%m.%Y') if item['date'] else u'Fußweg',
'duration': item['duration'].strftime('%H:%M'),
'price': item['price'],
'change': item['change'],
+ 'details': details[i],
}
if len(item['time']) == 2 and all(x is not None for x in item['time']):
d.update({'time_from': '-', 'time_to': '-'})
r.append(d)
+ i += 1
return r