feat(views.py): provide color and tags fields to calendar
This commit is contained in:
@@ -35,7 +35,7 @@ def get_calendar_events(request):
|
||||
end = request.GET.get("end")
|
||||
events = (
|
||||
EventPage.objects.live()
|
||||
.values("id", "title", "start", "end")
|
||||
.values("id", "title", "start", "end", "color", "tags")
|
||||
.filter(start__gte=start, end__lte=end)
|
||||
)
|
||||
|
||||
@@ -63,6 +63,8 @@ def get_calendar_event(request, event_id):
|
||||
"end": event.end,
|
||||
"location": event.location,
|
||||
"url": event.url,
|
||||
"color": event.color,
|
||||
"tags": list(event.tags.values_list("name", flat=True)),
|
||||
}
|
||||
|
||||
return JsonResponse(event_dict)
|
||||
|
||||
Reference in New Issue
Block a user