Beispiel #1
0
def get_bookmark_by_entities(request, entity=None):
    try:
        profile = request.user.profile
        results = profile.get_bookmarks(entity)
        serialized = BookmarkSerializer(results, many=True).data
        return Response(serialized)
    except Exception as e:
        return Response({}, status.HTTP_404_NOT_FOUND)
Beispiel #2
0
def get_bookmarks(request):
    try:
        profile = request.user.profile
        results = profile.get_bookmarks()
        serialized = BookmarkSerializer(results, many=True).data
        return Response(serialized)
    except Exception as e:
        print('NOT FOUND[dashboard.api14.get_bookmarks]')
        return Response({}, status.HTTP_404_NOT_FOUND)
Beispiel #3
0
 def get_bookmarks(request):
     try:
         profile = request.user.profile
         results = profile.get_bookmarks()
         serialized = BookmarkSerializer(results, many=True).data
         return JsonResponse({
             'status': 'ok',
             'result': serialized,
         },
                             status=200)
     except Exception as e:
         print(e)
         return not_authorized()