diff --git a/auctions/models.py b/auctions/models.py
index d8b4169..39b0266 100755
--- a/auctions/models.py
+++ b/auctions/models.py
@@ -1090,6 +1090,10 @@ def total_unsold_lots(self):
def total_lots(self):
return self.lots_qs.exclude(banned=True).count()
+ @property
+ def number_of_lots_with_scanned_qr(self):
+ return self.lots_qs.filter(pageview__source__icontains="qr", auction__pk=self.pk).distinct().count()
+
@property
def labels_qs(self):
lots = self.lots_qs.exclude(banned=True)
@@ -1110,7 +1114,7 @@ def percent_unsold_lots(self):
@property
def template_lot_link(self):
- """Not directly used in templates, use template_lot_link_first_column and template_lot_link_seperate_column instead"""
+ """Not directly used in templates, use template_lot_link_first_column and template_lot_link_separate_column instead"""
if timezone.now() > self.lot_submission_start_date:
result = f"View lots"
else:
@@ -1123,7 +1127,7 @@ def template_lot_link_first_column(self):
return mark_safe(f'
{self.template_lot_link}')
@property
- def template_lot_link_seperate_column(self):
+ def template_lot_link_separate_column(self):
"""Shown on big screens only"""
return mark_safe(f'{self.template_lot_link}')
@@ -2971,7 +2975,8 @@ def full_lot_link(self):
@property
def qr_code(self):
"""Full domain name URL used to for QR codes"""
- return f"{self.full_lot_link}?src=qr"
+ current_site = Site.objects.get_current()
+ return f"https://{current_site.domain}{reverse('lot_by_pk_qr', kwargs={'pk': self.pk})}"
@property
def seller_string(self):
diff --git a/auctions/tables.py b/auctions/tables.py
index 7fe87f2..5c27c65 100644
--- a/auctions/tables.py
+++ b/auctions/tables.py
@@ -1,6 +1,5 @@
import django_tables2 as tables
from django.urls import reverse
-from django.utils import formats
from django.utils.safestring import mark_safe
from .models import Auction, AuctionTOS, Lot
@@ -171,17 +170,17 @@ class AuctionHTMxTable(tables.Table):
hide_string = "d-md-table-cell d-none"
auction = tables.Column(accessor="title", verbose_name="Auction")
- date = tables.Column(accessor="date_start", verbose_name="Status")
+ date = tables.Column(accessor="date_start", verbose_name="Starts")
lots = tables.Column(
- accessor="template_lot_link_seperate_column",
+ accessor="template_lot_link_separate_column",
verbose_name="Lots",
orderable=False,
attrs={"th": {"class": hide_string}, "cell": {"class": hide_string}},
)
- def render_date(self, value, record):
- localized_date = formats.date_format(record.template_date_timestamp, use_l10n=True)
- return mark_safe(f"{record.template_status}{localized_date}{record.ended_badge}")
+ # def render_date(self, value, record):
+ # localized_date = formats.date_format(record.template_date_timestamp, use_l10n=True)
+ # return mark_safe(f"{record.template_status}{localized_date}{record.ended_badge}")
def render_auction(self, value, record):
auction = record
diff --git a/auctions/templates/all_lots.html b/auctions/templates/all_lots.html
index d7f4b0d..b6fc50e 100755
--- a/auctions/templates/all_lots.html
+++ b/auctions/templates/all_lots.html
@@ -54,7 +54,7 @@