class AgentFilter(filters.FilterSet): ip_state = ListFilter(field_name='information_packages__state', distinct=True) class Meta: model = Agent fields = ('ip_state', )
class InformationPackageFilter(django_filters.FilterSet): state = ListFilter(name='State') archival_institution = django_filters.UUIDFilter(name="ArchivalInstitution__pk") archivist_organization = django_filters.UUIDFilter(name='ArchivistOrganization__pk') archival_type = django_filters.UUIDFilter(name='ArchivalType__pk') archival_location = django_filters.UUIDFilter(name='ArchivalLocation__pk') class Meta: model = InformationPackage fields = [ 'state', 'archival_institution', 'archivist_organization', 'archival_type', 'archival_location' ]
class ArchivalLocationFilter(django_filters.FilterSet): ip_state = ListFilter(name='information_packages__State', distinct=True) class Meta: model = ArchivalLocation fields = ('ip_state', )
class F(filters.FilterSet): state = ListFilter() class Meta: model = InformationPackage fields = ['state']