2👍
✅
I just made a silly mistake! It wasn’t working because it didn’t put parentheses when calling functions is parent class! now this work like a charm.
class BaseListAPI(APIView):
__metaclass__ = abc.ABCMeta
def get(self, request):
search_object, start, count =
tools.handlers.read_get_request_data(request.GET)
order_by = request.GET.get('order_by')
return get_successful_response(self.get_query_set().list(
without_user_serializer=self.get_serializer(),
search_object=search_object,
start=start,
count=count,
order_by=order_by
))
@abc.abstractmethod
def get_query_set(self):
"""Method that should do something."""
@abc.abstractmethod
def get_serializer(self):
"""this method gets the serializer"""
Source:stackexchange.com