2018-08-12 13:06:26 +00:00
|
|
|
from django.shortcuts import render
|
2018-09-01 21:54:51 +00:00
|
|
|
from django_kepi.views import *
|
2018-09-16 20:42:27 +00:00
|
|
|
from django_kepi.models import *
|
2018-08-27 17:53:52 +00:00
|
|
|
from things_for_testing.models import *
|
|
|
|
|
|
|
|
class ThingUserCollection(CollectionView):
|
|
|
|
def get_collection_items(self, *args, **kwargs):
|
|
|
|
return ThingUser.objects.all()
|
|
|
|
|
|
|
|
def _stringify_object(self, obj):
|
2018-09-06 17:31:16 +00:00
|
|
|
return obj.activity
|
2018-09-01 17:19:48 +00:00
|
|
|
|
2018-09-16 20:42:27 +00:00
|
|
|
class ThingUserFollowingView(CollectionView):
|
2018-09-01 21:54:51 +00:00
|
|
|
|
|
|
|
def get_collection_items(self, *args, **kwargs):
|
2018-09-16 20:42:27 +00:00
|
|
|
return Activity.objects.filter(
|
2018-09-18 22:11:48 +00:00
|
|
|
f_type='Follow',
|
2018-09-27 16:53:25 +00:00
|
|
|
f_actor=ThingUser(name=kwargs['name']).activity_id,
|
2018-09-18 22:11:48 +00:00
|
|
|
accepted=True,
|
2018-09-16 20:42:27 +00:00
|
|
|
)
|
2018-09-01 21:54:51 +00:00
|
|
|
|
|
|
|
def _stringify_object(self, obj):
|
2018-09-27 16:53:25 +00:00
|
|
|
return obj.f_object
|
2018-09-01 21:54:51 +00:00
|
|
|
|
2018-09-16 20:42:27 +00:00
|
|
|
class ThingUserFollowersView(CollectionView):
|
2018-09-01 17:19:48 +00:00
|
|
|
|
|
|
|
def get_collection_items(self, *args, **kwargs):
|
2018-09-16 20:42:27 +00:00
|
|
|
return Activity.objects.filter(
|
2018-09-18 22:11:48 +00:00
|
|
|
f_type='Follow',
|
2018-09-27 16:53:25 +00:00
|
|
|
f_object=ThingUser(name=kwargs['name']).activity_id,
|
2018-09-18 22:11:48 +00:00
|
|
|
accepted=True,
|
2018-09-16 20:42:27 +00:00
|
|
|
)
|
2018-09-01 17:19:48 +00:00
|
|
|
|
2018-09-01 21:54:51 +00:00
|
|
|
def _stringify_object(self, obj):
|
2018-09-27 16:53:25 +00:00
|
|
|
return obj.f_actor
|
2018-09-01 21:54:51 +00:00
|
|
|
|
|
|
|
|