from django.core.paginator import Paginator
from django.forms import model_to_dict


from DCbackend.utils.common import success
from backend.models import Operation


class OperationService:
    @staticmethod
    def selectOperation(request):
        content_type_id = request.POST.get("content_type_id")

        operation = Operation.objects.filter(content_type_id=content_type_id)
        operation_list = [model_to_dict(operation) for operation in operation]
        return success(operation_list)