fix method
This commit is contained in:
parent
7541909390
commit
e6de2cc4f9
|
|
@ -2,7 +2,7 @@
|
|||
from datetime import datetime
|
||||
from functools import reduce
|
||||
from operator import or_
|
||||
from typing import List, Union
|
||||
from typing import List
|
||||
|
||||
import elasticsearch_dsl
|
||||
from django.conf import settings
|
||||
|
|
@ -184,10 +184,9 @@ class EstablishmentQuerySet(models.QuerySet):
|
|||
"""Return establishments by country code"""
|
||||
return self.filter(address__city__country=country)
|
||||
|
||||
def by_country_code(self, codes: Union[iter, str]):
|
||||
def by_country_code(self, code: str):
|
||||
"""Return establishments by country code"""
|
||||
codes = codes if hasattr(codes, '__iter__') else [codes]
|
||||
return self.filter(address__city__country__code__in=codes)
|
||||
return self.filter(address__city__country__code=code)
|
||||
|
||||
def published(self):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user