layerindex-web/layerindex/context_processors.py
Paul Eggleton c3a8eb4d82 Add support for importing OE-Classic recipes
Add a script for doing a one-time import of OE-Classic recipe
information, so comparisons against OE-Core can be performed; this
is stored using a new ClassicRecipe model supporting additional fields
for tracking migration status. The migration status fields can be
updated as well as viewed and summarised in graph format.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-05 00:31:22 +01:00

18 lines
641 B
Python

# layerindex-web - custom context processor
#
# Copyright (C) 2013 Intel Corporation
#
# Licensed under the MIT license, see COPYING.MIT for details
from layerindex.models import Branch, LayerItem
def layerindex_context(request):
current_branch = request.session.get('branch', None)
if not current_branch:
current_branch = 'master'
return {
'all_branches': Branch.objects.exclude(name='oe-classic').order_by('sort_priority'),
'current_branch': current_branch,
'unpublished_count': LayerItem.objects.filter(status='N').count(),
'oe_classic': Branch.objects.filter(name='oe-classic')
}