2018-08-07 15:21:45 +00:00
|
|
|
from django.shortcuts import render, get_object_or_404
|
2018-08-11 16:21:56 +00:00
|
|
|
import django.views
|
2018-08-07 15:21:45 +00:00
|
|
|
from django.http import HttpResponse, JsonResponse
|
|
|
|
from django.contrib.auth.decorators import login_required
|
|
|
|
import json
|
|
|
|
import re
|
|
|
|
|
|
|
|
def render(data):
|
|
|
|
# XXX merge in
|
|
|
|
result = JsonResponse(
|
|
|
|
data=data,
|
|
|
|
json_dumps_params={
|
|
|
|
'sort_keys': True,
|
|
|
|
'indent': 2,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
result['Content-Type'] = 'application/activity+json'
|
|
|
|
|
|
|
|
return result
|
|
|
|
|
2018-08-11 16:21:56 +00:00
|
|
|
class ActivityObjectView(django.views.View):
|
2018-08-07 15:21:45 +00:00
|
|
|
|
2018-08-11 16:21:56 +00:00
|
|
|
def get(self, request, *args, **kwargs):
|
2018-08-07 15:21:45 +00:00
|
|
|
|
2018-08-18 19:21:39 +00:00
|
|
|
#instance = ActivityObject.objects.get(pk=kwargs['id'])
|
|
|
|
instance = None # XXX temp
|
2018-08-07 15:21:45 +00:00
|
|
|
|
2018-08-19 15:49:48 +00:00
|
|
|
result = instance.serialize()
|
2018-08-06 13:44:35 +00:00
|
|
|
|
2018-08-11 16:21:56 +00:00
|
|
|
return render(result)
|