summaryrefslogtreecommitdiff
path: root/app/unused_apps/prompts/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/unused_apps/prompts/views.py')
-rw-r--r--app/unused_apps/prompts/views.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/unused_apps/prompts/views.py b/app/unused_apps/prompts/views.py
new file mode 100644
index 0000000..4744299
--- /dev/null
+++ b/app/unused_apps/prompts/views.py
@@ -0,0 +1,11 @@
+from django.views.generic.detail import DetailView
+
+from .models import Prompt
+
+
+class PromptList(DetailView):
+ model = Prompt
+
+ def get_object(self, queryset):
+ """ This might be faster: random.choice(Prompt.objects.all())"""
+ return Prompt.objects.order_by('?').first()