vcp-elearning/tkupek_elearning/elearning/views.py

14 lines
393 B
Python
Raw Normal View History

2016-01-31 16:17:37 +01:00
from django.shortcuts import render_to_response
2016-01-31 18:19:45 +01:00
from tkupek_elearning.elearning.models import Setting, Question
#import pdb; pdb.set_trace()
2016-01-31 16:17:37 +01:00
def home(request):
2016-01-31 18:19:45 +01:00
questions = Question.objects.all()
settings = Setting.objects.filter(active=1)
if(settings) :
settings = settings[0]
2016-01-31 16:17:37 +01:00
2016-01-31 18:19:45 +01:00
return render_to_response('index.html', {'settings': settings, 'questions': questions})