0001-api-optimize-fillslot-endpoint-calculation-in-meetin.patch
chrono/api/views.py | ||
---|---|---|
173 | 173 | |
174 | 174 |
entries.sort(key=lambda x: x.start_datetime) |
175 | 175 | |
176 |
fillslot_url = request.build_absolute_uri( |
|
177 |
reverse('api-fillslot', |
|
178 |
kwargs={ |
|
179 |
'agenda_identifier': agenda.slug, |
|
180 |
'event_pk': '00000', |
|
181 |
})) |
|
182 | ||
176 | 183 |
response = {'data': [{'id': x.id, |
177 | 184 |
'datetime': localtime(x.start_datetime).strftime('%Y-%m-%d %H:%M:%S'), |
178 | 185 |
'text': unicode(x), |
179 | 186 |
'disabled': bool(x.full), |
180 | 187 |
'api': { |
181 |
'fillslot_url': request.build_absolute_uri( |
|
182 |
reverse('api-fillslot', |
|
183 |
kwargs={ |
|
184 |
'agenda_identifier': agenda.slug, |
|
185 |
'event_pk': x.id, |
|
186 |
})), |
|
187 |
} |
|
188 |
} for x in entries]} |
|
188 |
'fillslot_url': fillslot_url.replace('00000', str(x.id)), |
|
189 |
}, |
|
190 |
} for x in entries]} |
|
189 | 191 |
return Response(response) |
190 | 192 | |
191 | 193 |
meeting_datetimes = MeetingDatetimes.as_view() |
192 |
- |