Schule als Staat Projekt Web, Dokumente, etc.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
338B

  1. from django.shortcuts import render
  2. import math
  3. from .models import Entry
  4. # Create your views here.
  5. def index(request):
  6. rows = group(Entry.objects.all(), 3)
  7. print("rows", rows)
  8. return render(request, "datenbank/index.html", {'rows': rows})
  9. def group(l, n):
  10. return [l[k*n:k*n+n] for k in range(math.ceil(len(l) / n))]