diff --git a/layerindex/context_processors.py b/layerindex/context_processors.py index 90fc0f8..44f1f80 100644 --- a/layerindex/context_processors.py +++ b/layerindex/context_processors.py @@ -11,7 +11,7 @@ def layerindex_context(request): if not current_branch: current_branch = 'master' return { - 'all_branches': Branch.objects.all(), + 'all_branches': Branch.objects.all().order_by('sort_priority'), 'current_branch': current_branch, 'unpublished_count': LayerItem.objects.filter(status='N').count(), } \ No newline at end of file diff --git a/layerindex/models.py b/layerindex/models.py index b581d8d..35febf1 100644 --- a/layerindex/models.py +++ b/layerindex/models.py @@ -15,6 +15,7 @@ class Branch(models.Model): name = models.CharField(max_length=50) bitbake_branch = models.CharField(max_length=50) short_description = models.CharField(max_length=50, blank=True) + sort_priority = models.IntegerField(blank=True, null=True) class Meta: verbose_name_plural = "Branches"