fixed for stats_admin geo filtering

This commit is contained in:
Sam
2021-03-12 11:17:17 +00:00
parent 7a2e80b43e
commit 712cabe3da

View File

@@ -209,9 +209,9 @@ def admin_stats(request):
products_per_region = {} products_per_region = {}
for region in Region.objects.all(): for region in Region.objects.all():
count = Company.objects.filter(geo__dwithin=region.geo).count() count = Company.objects.filter(geo__within=region.geo).count()
companies_per_region[region.name] = count companies_per_region[region.name] = count
count = Product.objects.filter(company__geo__dwithin=region.geo).count() count = Product.objects.filter(company__geo__within=region.geo).count()
products_per_region[region.name] = count products_per_region[region.name] = count
data = { data = {