Sorted the order of the menu items
This commit is contained in:
@@ -34,11 +34,11 @@ class Category(CommonInfo):
|
||||
|
||||
@property
|
||||
def active_children(self):
|
||||
return self.children.filter(active=True)
|
||||
return self.children.filter(active=True).order_by('name')
|
||||
|
||||
@property
|
||||
def active_samples(self):
|
||||
return self.samples.filter(active=True)
|
||||
return self.samples.filter(active=True).order_by('name')
|
||||
|
||||
|
||||
class Sample(CommonInfo):
|
||||
|
||||
@@ -19,9 +19,9 @@ class HomeView(generic.ListView):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(HomeView, self).get_context_data(**kwargs)
|
||||
context['active_samples'] = Sample.objects.filter(active=True)
|
||||
context['active_samples'] = Sample.objects.filter(active=True).order_by('name')
|
||||
context['parent_categories'] = Category.objects.filter(parent=None). \
|
||||
filter(active=True)
|
||||
filter(active=True).order_by('name')
|
||||
return context
|
||||
|
||||
|
||||
@@ -33,11 +33,11 @@ class DetailView(generic.DetailView):
|
||||
model = Sample
|
||||
template_name = 'three_d_viewer/detail.html'
|
||||
parent_categories = Category.objects.filter(parent=None). \
|
||||
filter(active=True)
|
||||
filter(active=True).order_by("name")
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(DetailView, self).get_context_data(**kwargs)
|
||||
context['active_samples'] = Sample.objects.filter(active=True)
|
||||
context['active_samples'] = Sample.objects.filter(active=True).order_by('name')
|
||||
context['parent_categories'] = Category.objects.filter(parent=None). \
|
||||
filter(active=True)
|
||||
filter(active=True).order_by('name')
|
||||
return context
|
||||
|
||||
Reference in New Issue
Block a user