Download pool/shard006/Python/0053817_views.py from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 882 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard006/Python/0053817_views.py
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard006/Python/0053817_views.py
-
curl -L -o 0053817_views.py https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard006/Python/0053817_views.py
882 Bytes
| # -*- coding: utf-8 -*- | |
| from django.shortcuts import render, get_object_or_404 | |
| from threads.models import Subject, Thread, Post | |
| from django.shortcuts import redirect | |
| from django.contrib import messages, auth | |
| from django.contrib.auth.decorators import login_required | |
| from django.core.urlresolvers import reverse | |
| from django.template.context_processors import csrf | |
| # Create your views here. | |
| def forum(request): | |
| """ | |
| forum(): pull the all subjects from the database and pass them to our view | |
| """ | |
| return render(request, 'forum/forum.html', {'subjects': Subject.objects.all()}) | |
| def threads(request, subject_id): | |
| """ | |
| threads(): | |
| """ | |
| subject = get_object_or_404(Subject, pk=subject_id) | |
| return render(request, 'forum/threads.html', {'subject': subject}) | |
| def new_thread(request, subject_id): | |
| """ | |
| new_thread(): | |
| """ | |
| pass | |