diff --git a/artshow/reports.py b/artshow/reports.py index 8070368..a6fc70a 100644 --- a/artshow/reports.py +++ b/artshow/reports.py @@ -4,7 +4,7 @@ from decimal import Decimal from django.shortcuts import render from django.db.models import ( - Case, Count, Exists, Max, OuterRef, Q, Subquery, Sum, Value as V, When + Case, Count, Exists, F, Max, OuterRef, Q, Subquery, Sum, Value as V, When ) from django.db.models.fields import DecimalField from django.db.models.functions import Coalesce @@ -114,6 +114,14 @@ def unsold_pieces(request): {'bidders': bidders}) +@permission_required('artshow.is_artshow_staff') +def scanned_pieces(request): + pieces = Piece.objects.order_by(F('bids_updated').asc(nulls_first=True), 'location', 'artist__artistid', 'pieceid') + + return render(request, 'artshow/reports-scanned-pieces.html', + {'pieces': pieces}) + + @permission_required('artshow.is_artshow_staff') def artist_piece_report(request, artist_id): artist = Artist.objects.get(id=artist_id) diff --git a/artshow/templates/artshow/reports-scanned-pieces.html b/artshow/templates/artshow/reports-scanned-pieces.html new file mode 100644 index 0000000..f226215 --- /dev/null +++ b/artshow/templates/artshow/reports-scanned-pieces.html @@ -0,0 +1,25 @@ +{% extends "artshow/base_generic.html" %} +{% block title %}Scanned Pieces Report{% endblock %} +{% block breadcrumbs %} +
+{% endblock %} +{% block content %} +Last Scanned | +Location | +Piece | +
---|---|---|
{{ piece.bids_updated|date:"l, P" }} | +{{ piece.location }} | +{{ piece }} | +