summaryrefslogtreecommitdiff
path: root/app/unused_apps/prompts/views.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2020-08-15 11:58:34 -0400
committerluxagraf <sng@luxagraf.net>2020-08-15 11:58:34 -0400
commitb66d000ee469539ce7aea557b612c0444177e36d (patch)
tree273547921dc6f9ded2a5681b82514c68e28ba448 /app/unused_apps/prompts/views.py
parentd3e57c1bd17ad3e71810235a672d4782136901a5 (diff)
archived old unused apps and migrated fieldnotes to posts
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()