1
Fork 0
yamdl-playground/yamdl_playground/core/views.py

11 lines
402 B
Python
Raw Normal View History

from .models import Page
from django.http import HttpResponse
2023-12-08 14:53:17 +00:00
from django.db import connections
def test(request):
2023-12-08 14:53:17 +00:00
with connections["default"].cursor() as cursor:
cursor.execute("SELECT rowid FROM search_index WHERE search_index = %s;", ["content"])
row = cursor.fetchone()
pages = Page.objects.filter(id__in=row)
return HttpResponse(str(pages), content_type="text/plain")