@property
    def page_context(self):
        selected_id = self.request.GET.get('selected')
        has_location_types = len(self.domain_object.location_types) > 0
        loc_restricted = self.request.project.location_restriction_for_users
        return {
            'selected_id': selected_id,
            'locations': load_locs_json(self.domain, selected_id, self.show_inactive, self.request.couch_user),
            'show_inactive': self.show_inactive,
            'has_location_types': has_location_types,
            'can_edit_root': (
                not loc_restricted or (loc_restricted and not self.request.couch_user.get_location(self.domain))),
            'can_edit_any_location': user_can_edit_any_location(self.request.couch_user, self.request.project),
        }
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/locations/views.py/LocationsListView.page_context/original