def __init__(self, request, data, _all=False, **kwargs):
        super(DnsRecordFilterForm, self).__init__(data, **kwargs)
        domains = Domain.objects.order_by('name')
        user, dc = request.user, request.dc

        if request.GET.get('deleted', False):
            domains = domains.exclude(access=Domain.INTERNAL)
        else:
            domains = domains.exclude(access__in=Domain.INVISIBLE)

        if user.is_staff and _all:
            domain_choices = [(d.name, d.name) for d in domains]
        else:
            dc_domain_ids = list(dc.domaindc_set.values_list('domain_id', flat=True))
            domains = domains.filter(Q(id__in=dc_domain_ids) | Q(user=user.id))
            domain_choices = [(d.name, d.name) for d in domains
                              if (user.is_staff or d.user == user.id or d.dc_bound == dc.id)]

        self.fields['domain'].choices = domain_choices