mirror of
https://github.com/nikdoof/vapemap.git
synced 2025-12-23 14:49:27 +00:00
Add support for brand stockist searches.
This commit is contained in:
11
app/stores/views/brands.py
Normal file
11
app/stores/views/brands.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from django.views.generic import ListView
|
||||
from ..models import Brand
|
||||
|
||||
|
||||
class BrandListView(ListView):
|
||||
model = Brand
|
||||
paginate_by = 10
|
||||
|
||||
def get_queryset(self):
|
||||
qs = super(BrandListView, self).get_queryset()
|
||||
return qs.exclude(stores=None).prefetch_related('stores')
|
||||
Reference in New Issue
Block a user