title: How can I render product category and it's subcategory list alphabetically sorted in Django-Oscar?
body: <p>I can render the product category list in template. But the category list are not showing in alphabetical order. How can I render them in alphabetical order ?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I am using the following code to render categories and subcategories.</p>
  
  <pre><code>&lt;ul class="cd-accordion-menu animated"&gt;
                  {% for tree_category, info in tree_categories %}
                      &lt;li {% if info.has_children %}class="has-children"
                          {% else %}{% endif %}&gt;
  
                          {% if info.has_children %}
  
                              &lt;input type="checkbox" name="{{ tree_category.name|lower }}"
                                     id="{{ tree_category.name|lower }}"&gt;
                              &lt;label for="{{ tree_category.name|lower }}"&gt;{{ tree_category.name|safe }}
                          {% else %}
                              &lt;a href="{{ tree_category.get_absolute_url }}"&gt;{{ tree_category.name|safe }}&lt;/a&gt;
                          {% endif %}
                          {% if info.has_children %}&lt;/label&gt;{% endif %}
  
                          {% if info.has_children %}
                              &lt;ul&gt;
                          {% endif %}
  
                          {% for n in info.num_to_close %}
                              &lt;/ul&gt;
                              &lt;/li&gt;
                          {% endfor %}
                  {% endfor %}
              &lt;/ul&gt;
  </code></pre>
  
  <p><strong>This shows the categories as below.</strong>
  <a href="https://i.stack.imgur.com/znc4W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/znc4W.png" alt="enter image description here"></a></p>