File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ <h2>List of Brands</h2>
2121 </ tr >
2222 </ thead >
2323 < tbody >
24- {% for brand in brands|dictsort:"name " %}
24+ {% for brand in brands|dictsort:"name_lower " %}
2525 < tr >
2626 < td > < a href ="{% url 'brands:detail' brand_id=brand.id %} "> {{ brand.name }}</ a > </ td >
2727 < td > {{ brand.get_provider_types }}</ td >
Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ class Meta:
2525 secondary_color = models .CharField (max_length = 7 )
2626 background_color = models .CharField (max_length = 7 , blank = True , null = True )
2727
28+ @property
29+ def name_lower (self ):
30+ return self .name .lower () if self .name else ''
31+
2832 def get_provider_types (self ):
2933 unique_types = self .providers .values_list ('type' , flat = True ).distinct ()
3034 results = []
You can’t perform that action at this time.
0 commit comments