You can make the database sort the dashboards directly:

```python
for dashboard in Dashboard.objects.order_by('name'):
    # etc etc
```

`name` is a primary key here so this will even be properly optimized at the database level.