Created
May 29, 2021 00:48
-
-
Save gabrielloliveira/e89d2d92c3da25fa61d02a81c0cb31ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import uuid | |
from decimal import Decimal | |
from rest_framework import generics | |
from rest_framework.response import Response | |
def fake_some_model_data() -> dict: | |
return { | |
"uuid": str(uuid.uuid4()), | |
"name": "Algum nome aleatório bem grande", | |
"email": "algumemailaleatorio@email.com", | |
"birthday": datetime.date(2021, 5, 28), | |
"is_premium": True, | |
"cash": Decimal(957.78), | |
"invoice_date": 28, | |
} | |
class IndexList(generics.ListAPIView): | |
def get(self, request, *args, **kwargs): | |
some_big_query_data = [] | |
for _ in range(1000000): | |
some_big_query_data.append(fake_some_model_data()) | |
return Response(some_big_query_data) | |
index = IndexList.as_view() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment