From 6b52feffd809762a81653f4afbe5897d725ab73b Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 30 Dec 2019 16:38:42 +0300 Subject: [PATCH] fix similar_artisans_producers --- apps/establishment/models.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/establishment/models.py b/apps/establishment/models.py index b9e36b51..551f475c 100644 --- a/apps/establishment/models.py +++ b/apps/establishment/models.py @@ -199,8 +199,11 @@ class EstablishmentQuerySet(models.QuerySet): Description: """ - return self.annotate(distance=Distance('address__coordinates', point, - srid=settings.GEO_DEFAULT_SRID)) + return self.annotate(distance=Distance( + 'address__coordinates', + point, + srid=settings.GEO_DEFAULT_SRID + )) def annotate_intermediate_public_mark(self): """ @@ -321,9 +324,8 @@ class EstablishmentQuerySet(models.QuerySet): return self.similar_base(establishment) \ .same_subtype(establishment) \ .has_published_reviews() \ - .order_by(similarity_rules['ordering']) \ - .distinct(similarity_rules['distinctions'], - 'id') + .order_by(*similarity_rules['ordering']) \ + .distinct(*similarity_rules['distinctions'], 'id') def by_wine_region(self, wine_region): """