also, check out https://github.com/dimagi/commcare-hq/blob/master/corehq/apps/users/cases.py#L17