n = ProductGroop.objects.all()
n = n[0].name_groop
n = guestionNum.objects.all()
n = n[:1]
n = int(n)
answers = Answer.objects.all().order_by('?')[:n]
n = str(n)ошибка '>=' not supported between instances of 'str' and 'int' как мне сделать срез по n, беру n с БД?
def home (request):
questions = Article.objects.order_by('?')
#count = Answer.objects.count()
#count = random.randint(0, count - 1)
n = guestionNum.objects.all()
n = n.first
answers = Answer.objects.all().order_by('?')[:n]
#answers = answers[:5]
return render_to_response('question/home.html', {'questions': questions, 'answers': answers, 'n':n, 'username':auth.get_user(request).username})