def templates_for_device(request, templates):
 from mezzanine.conf import settings
 if (not isinstance(templates, (list, tuple))):
  templates = [templates]
 device = device_from_request(request)
 device_templates = []
 for template in templates:
  if device:
   device_templates.append((u'%s/%s' % (device, template)))
  if (settings.DEVICE_DEFAULT and (settings.DEVICE_DEFAULT != device)):
   default = (u'%s/%s' % (settings.DEVICE_DEFAULT, template))
   device_templates.append(default)
  device_templates.append(template)
 return device_templates

def templates_for_device ( request , templates ) : from mezzanine . conf import settings if ( not isinstance ( templates , ( list , tuple ) ) ) : templates = [ templates ] device = device_from_request ( request ) device_templates = [ ] for template in templates : if device : device_templates . append ( ( u'%s/%s' % ( device , template ) ) ) if ( settings . DEVICE_DEFAULT and ( settings . DEVICE_DEFAULT != device ) ) : default = ( u'%s/%s' % ( settings . DEVICE_DEFAULT , template ) ) device_templates . append ( default ) device_templates . append ( template ) return device_templates
given a template name .