Return group with given name, if it exists. Check cache first.

def get_group(name):
    """
    Return group with given name, if it exists. Check cache first.
    """
    group = cache.get('bits.general.group_%s' % name)
    if not group:
        group = Group.objects.get(name=name)
        cache.set('bits.general.group_%s' % name, group, 365 * 24 * 60 * 60)
    return group