@@ -0,0 +1,996 @@
+import settings%0Afrom corehq.apps.groups.models import Group%0A%0A%0Adef group_by_domain(domain, include_docs=True, **kwargs):%0A    return Group.view(%0A        'groups/by_domain',%0A        key=domain,%0A        include_docs=include_docs,%0A        **kwargs%0A    )%0A%0A%0Adef stale_group_by_domain(domain, include_docs=True, **kwargs):%0A    return group_by_domain(%0A        domain,%0A        include_docs=include_docs,%0A        stale=settings.COUCH_STALE_QUERY,%0A        **kwargs%0A    )%0A%0A%0Adef group_by_name(domain, name, include_docs=True, **kwargs):%0A    return Group.view(%0A        'groups/by_name',%0A        key=%5Bdomain, name%5D,%0A        include_docs=include_docs,%0A        **kwargs%0A    )%0A%0A%0Adef stale_group_by_name(domain, name, include_docs=True, **kwargs):%0A    return group_by_name(%0A        domain,%0A        name,%0A        include_docs=include_docs,%0A        stale=settings.COUCH_STALE_QUERY,%0A        **kwargs%0A    )%0A%0A%0Adef refresh_group_views(group):%0A    group_by_domain(group.domain)%0A    group_by_name(group.domain, group.name)%0A

add dbaccessors for groups