possible fix for similar distilleries
This commit is contained in:
parent
677d67cbc5
commit
21978639bd
|
|
@ -365,10 +365,10 @@ class EstablishmentQuerySet(models.QuerySet):
|
|||
Return QuerySet with objects that similar to Distillery.
|
||||
:param distillery: Establishment instance
|
||||
"""
|
||||
base_qs = self.similar_base(distillery).same_subtype(distillery)
|
||||
base_qs = self.similar_base(distillery).same_subtype(distillery).exclude(same_subtype=False)
|
||||
similarity_rules = {
|
||||
'ordering': [F('same_subtype').desc(), ],
|
||||
'distinctions': ['same_subtype', ]
|
||||
'distinctions': [],
|
||||
'ordering': [],
|
||||
}
|
||||
if distillery.address and distillery.address.coordinates:
|
||||
base_qs = base_qs.annotate_distance(point=distillery.location)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user