Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.shortcuts import render
- # Create your views here.
- from django.views.generic.base import View
- from .models import University
- from .models import olympiads
- """class UniversityView(View):
- def get(self, request):"""
- class UniversityView(View):
- def get(self, request, pk=-1):
- if pk == -1:
- """Список университетов"""
- universities = University.objects.all()
- return render(request, "universities/list_all.html", {"universities_list": universities})
- else:
- """Информация о университете"""
- univer = University.objects.get(id=pk)
- return render(request, "universities/list_id.html", {"univer": univer})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement