Refactoring
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
from django.shortcuts import render
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import redirect
|
||||
from core.models import Video
|
||||
import random
|
||||
|
||||
# Create your views here.
|
||||
|
||||
@@ -11,10 +8,9 @@ def core(request):
|
||||
videos = Video.objects.all()
|
||||
return render(request, 'base.html', {'videos': videos[::-1]})
|
||||
|
||||
|
||||
def random(request):
|
||||
videos = Video.objects.all().order_by("?")
|
||||
ran = videos.first();
|
||||
ran = videos.first()
|
||||
return redirect('/view/'+str(ran.id))
|
||||
|
||||
def status(request):
|
||||
|
||||
Reference in New Issue
Block a user