mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
Add sort priority field to branch model
This enables sorting the branch drop-down in a configurable manner (e.g. so that you can have them in order from newest to oldest). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
f6fb84db4b
commit
af499c0d99
|
@ -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(),
|
||||
}
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue
Block a user