views.py 465 B

1234567891011121314151617
  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. from django.shortcuts import render
  4. from django.contrib.auth.decorators import login_required
  5. from .models import Item, Loan
  6. @login_required
  7. def loan_list(request):
  8. loans = request.user.loans.all()
  9. return render(request, 'hardware_provisioning/list.html', {'loans': loans})
  10. @login_required
  11. def loan_detail(request, pk):
  12. return render(request, 'hardware_provisioning/detail.html', {})