Download pool/shard007/Python/0062707_views.py from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 859 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard007/Python/0062707_views.py
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard007/Python/0062707_views.py
-
curl -L -o 0062707_views.py https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard007/Python/0062707_views.py
859 Bytes
| from django.views.generic import TemplateView, ListView | |
| from blog.models import Post | |
| class WelcomeView(ListView): | |
| template_name = 'hydra/welcome.html' | |
| def get_context_data(self, **kwargs): | |
| context = super().get_context_data(**kwargs) | |
| context['page'] = 'index' | |
| return context | |
| def get_queryset(self): | |
| return Post.objects.all().order_by('-date')[:5] | |
| class AboutView(TemplateView): | |
| template_name = 'hydra/about.html' | |
| def get_context_data(self, **kwargs): | |
| context = super().get_context_data(**kwargs) | |
| context['page'] = 'about' | |
| return context | |
| class ContactView(TemplateView): | |
| template_name = 'hydra/online-presence.html' | |
| def get_context_data(self, **kwargs): | |
| context = super().get_context_data(**kwargs) | |
| context['page'] = 'contact' | |
| return context | |