Here is a function view:
def base(request):
shipments = Shipment.objects.all().order_by("-slabel")[:5]
suppliers = Supplier.objects.all()
context = {
"shipments": shipments,
"suppliers": suppliers,
}
return render(request, "base/dashboard.html", context)
I tried to figure this out myself but apparently I can't. I want to
convert this to a class based view if possible but I couldn't figure out
how to send the context data to the .html file. Not sure it that is even
possible. I am new to django for sure.
Frank
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/95d0558e-5f34-4e81-b20c-c95aee4af739n%40googlegroups.com.