city filter for establishment
This commit is contained in:
parent
32ae1856b6
commit
ae486d81fa
|
|
@ -13,6 +13,8 @@ class EstablishmentFilter(filters.FilterSet):
|
||||||
search = filters.CharFilter(method='search_text')
|
search = filters.CharFilter(method='search_text')
|
||||||
type = filters.CharFilter(method='by_type')
|
type = filters.CharFilter(method='by_type')
|
||||||
subtype = filters.CharFilter(method='by_subtype')
|
subtype = filters.CharFilter(method='by_subtype')
|
||||||
|
city_id = filters.CharFilter(field_name='address__city__id')
|
||||||
|
city_name = filters.CharFilter(field_name='address__city__name')
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
"""Meta class."""
|
"""Meta class."""
|
||||||
|
|
@ -24,6 +26,8 @@ class EstablishmentFilter(filters.FilterSet):
|
||||||
'search',
|
'search',
|
||||||
'type',
|
'type',
|
||||||
'subtype',
|
'subtype',
|
||||||
|
'city_id',
|
||||||
|
'city_name',
|
||||||
)
|
)
|
||||||
|
|
||||||
def search_text(self, queryset, name, value):
|
def search_text(self, queryset, name, value):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user