Esempio n. 1
0
class FacilityOperationStateFilter(CommonFieldsFilterset):
    operation_status = django_filters.AllValuesFilter(lookup_type='exact')
    facility = django_filters.AllValuesFilter(lookup_type='exact')
    reason = django_filters.CharFilter(lookup_type='exact')

    class Meta(object):
        model = FacilityOperationState
Esempio n. 2
0
class FacilityFilter(CommonFieldsFilterset):
    name = django_filters.CharFilter(lookup_type='icontains')
    code = django_filters.NumberFilter(lookup_type='exact')
    description = django_filters.CharFilter(lookup_type='icontains')

    facility_type = django_filters.AllValuesFilter(lookup_type='exact')
    operation_status = django_filters.AllValuesFilter(lookup_type='exact')
    ward = django_filters.AllValuesFilter(lookup_type='exact')
    owner = django_filters.AllValuesFilter(lookup_type='exact')
    officer_in_charge = django_filters.AllValuesFilter(lookup_type='exact')

    number_of_beds = django_filters.NumberFilter(lookup_type='exact')
    number_of_cots = django_filters.NumberFilter(lookup_type='exact')

    open_whole_day = django_filters.TypedChoiceFilter(choices=BOOLEAN_CHOICES,
                                                      coerce=strtobool)
    open_whole_week = django_filters.TypedChoiceFilter(choices=BOOLEAN_CHOICES,
                                                       coerce=strtobool)
    is_classified = django_filters.TypedChoiceFilter(choices=BOOLEAN_CHOICES,
                                                     coerce=strtobool)
    is_published = django_filters.TypedChoiceFilter(choices=BOOLEAN_CHOICES,
                                                    coerce=strtobool)

    class Meta(object):
        model = Facility
Esempio n. 3
0
class CompetitionFilter(django_filters.FilterSet):
    from_achievement_date = django_filters.DateTimeFilter(
        field_name='distance_achievement_date', lookup_expr='gte')
    to_achievement_date = django_filters.DateTimeFilter(
        field_name='distance_achievement_date', lookup_expr='lte')

    min_distance_in_feet = django_filters.NumberFilter(
        field_name='distance_in_feet', lookup_expr='gte')
    max_distance_in_feet = django_filters.NumberFilter(
        field_name='distance_in_feet', lookup_expr='lte')

    drone_name = django_filters.AllValuesFilter(field_name='drone__name')
    pilot_name = django_filters.AllValuesFilter(field_name='pilot__name')

    class Meta:
        model = Competition
        fields = (
            'distance_in_feet',
            'from_achievement_date',
            'to_achievement_date',
            'min_distance_in_feet',
            'max_distance_in_feet',
            'drone_name',
            'pilot_name',
        )
Esempio n. 4
0
class FacilityServiceRatingFilter(CommonFieldsFilterset):
    facility = django_filters.AllValuesFilter(
        name='facility_service__facility', lookup_type='exact')
    service = django_filters.AllValuesFilter(name="facility_service__service",
                                             lookup_type='exact')

    class Meta(object):
        model = FacilityServiceRating
Esempio n. 5
0
class FacilityRegulationStatusFilter(CommonFieldsFilterset):
    facility = django_filters.AllValuesFilter(lookup_type='exact')
    regulating_body = django_filters.AllValuesFilter(lookup_type='exact')
    regulation_status = django_filters.AllValuesFilter(lookup_type='exact')
    reason = django_filters.CharFilter(lookup_type='icontains')

    class Meta(object):
        model = FacilityRegulationStatus
Esempio n. 6
0
class ProductFilter(django_filters.FilterSet):
    place = django_filters.AllValuesFilter(field_name="place")
    title = django_filters.AllValuesFilter(field_name="title")

    o = django_filters.OrderingFilter(fields={('date',
                                               'date'), ('price', 'price')})

    class Meta:
        fields = ['place', 'title']
Esempio n. 7
0
class BranchFilter(django_filters.FilterSet):
    # Initialise field variables
    state = django_filters.AllValuesFilter(field_name="state")
    city = django_filters.AllValuesFilter(field_name="city")

    # Class meta attributes - configure model to use and which fields to include
    class Meta:
        model = Branch
        # Can be set to exclude filter fields or include filter fields.
        exclude = ['branchid', 'street', 'tellno']
Esempio n. 8
0
class FacilityInfrastructureFilter(CommonFieldsFilterset):
    facility = django_filters.AllValuesFilter(lookup_expr='exact')
    infrastructure = django_filters.AllValuesFilter(lookup_expr='exact')
    is_confirmed = django_filters.TypedChoiceFilter(choices=BOOLEAN_CHOICES,
                                                    coerce=strtobool)
    is_cancelled = django_filters.TypedChoiceFilter(choices=BOOLEAN_CHOICES,
                                                    coerce=strtobool)

    class Meta(CommonFieldsFilterset.Meta):
        model = FacilityInfrastructure
Esempio n. 9
0
class FacilityServiceFilter(CommonFieldsFilterset):
    facility = django_filters.AllValuesFilter(lookup_type='exact')
    option = django_filters.AllValuesFilter(lookup_type='exact')
    is_confirmed = django_filters.TypedChoiceFilter(choices=BOOLEAN_CHOICES,
                                                    coerce=strtobool)
    is_cancelled = django_filters.TypedChoiceFilter(choices=BOOLEAN_CHOICES,
                                                    coerce=strtobool)

    class Meta(object):
        model = FacilityService
Esempio n. 10
0
class ProductFilter(django_filters.FilterSet):
    manufacturer = django_filters.AllValuesFilter(field_name="manufacturer")
    make = django_filters.AllValuesFilter(field_name="make")
    model = django_filters.AllValuesFilter(field_name="model")

    o = django_filters.OrderingFilter(fields={('build_year',
                                               'build_year'), ('price',
                                                               'price')})

    class Meta:
        model = Product
        fields = ['manufacturer', 'make', 'model']
Esempio n. 11
0
class CommunityHealthUnitFilter(CommonFieldsFilterset):
    name = django_filters.CharFilter(lookup_type='icontains')
    facility = django_filters.AllValuesFilter(lookup_type='exact')
    community = django_filters.AllValuesFilter(lookup_type='exact')
    ward = django_filters.CharFilter(name='community__ward')
    constituency = django_filters.CharFilter(
        name='community_ward__constituency')
    county = django_filters.CharFilter(
        name='community__ward__constituency__county')

    class Meta(object):
        model = CommunityHealthUnit
Esempio n. 12
0
class SwordFilter(django_filters.FilterSet):
    sword_type = django_filters.AllValuesFilter()
    manufacturer = django_filters.AllValuesFilter()
    name = django_filters.CharFilter(lookup_expr='icontains',
                                     label="Model Keywords")

    class Meta:
        model = Sword
        fields = [
            'manufacturer',
            'sword_type',
            'name',
        ]
Esempio n. 13
0
class PlayerScoreFilter(django_filters.FilterSet):
    min_score = django_filters.NumberFilter(field_name='score', lookup_expr='gte')
    max_score = django_filters.NumberFilter(field_name='score', lookup_expr='lte')
    from_score_date = django_filters.DateTimeFilter(field_name='score_date', lookup_expr='gte')
    to_score_date = django_filters.DateTimeFilter(field_name='score_date', lookup_expr='lte')
    player_name = django_filters.AllValuesFilter(field_name='player__name')
    game_name = django_filters.AllValuesFilter(field_name='game__name')

    class Meta:
        model = PlayerScore
        fields = [
            'score', 'min_score', 'max_score', 'from_score_date',
            'to_score_date', 'player_name', 'game_name'
        ]
Esempio n. 14
0
class VehicleStatusFilter(django_filters.FilterSet):
    vehicleid = django_filters.AllValuesFilter(field_name="vehicleid")
    vehiclestatus = django_filters.AllValuesFilter(field_name="vehiclestatus")

    class Meta:
        model = Vehicles
        fields = [
            'vehicleid',
            'make',
            'model',
            'series',
            'year',
            'vehiclestatus',
        ]
Esempio n. 15
0
class OffersFilter(django_filters.FilterSet):

    category  = django_filters.AllValuesFilter( widget=django_filters.widgets.LinkWidget(), field_name="category", label="Category")

    class Meta:
        model = OffersAd
        fields = ['category']
Esempio n. 16
0
class OfficerFilter(CommonFieldsFilterset):
    name = django_filters.CharFilter(lookup_type='icontains')
    registration_number = django_filters.CharFilter(lookup_type='icontains')
    job_title = django_filters.AllValuesFilter(lookup_type='exact')

    class Meta(object):
        model = Officer
Esempio n. 17
0
class FacilityUnitFilter(CommonFieldsFilterset):
    name = django_filters.CharFilter(lookup_type='icontains')
    description = django_filters.CharFilter(lookup_type='icontains')
    facility = django_filters.AllValuesFilter(lookup_type='exact')

    class Meta(object):
        model = FacilityUnit
Esempio n. 18
0
class FacilityServiceRatingFilter(CommonFieldsFilterset):
    facility = django_filters.AllValuesFilter(
        name='facility_service__facility', lookup_expr='exact')
    service = django_filters.AllValuesFilter(name="facility_service__service",
                                             lookup_expr='exact')
    county = django_filters.AllValuesFilter(
        name="facility_service__facility__ward__constituency__county",
        lookup_expr='exact')
    constituency = django_filters.AllValuesFilter(
        name="facility_service__facility__ward__constituency",
        lookup_expr='exact')
    ward = django_filters.AllValuesFilter(
        name="facility_service__facility__ward", lookup_expr='exact')

    class Meta(CommonFieldsFilterset.Meta):
        model = FacilityServiceRating
Esempio n. 19
0
class WardBoundaryFilter(CommonFieldsFilterset):
    name = django_filters.CharFilter(lookup_type='icontains')
    code = django_filters.CharFilter(lookup_type='icontains')
    area = django_filters.AllValuesFilter(lookup_type='exact')

    class Meta(object):
        model = WardBoundary
Esempio n. 20
0
class DeviceFilter(django_filters.FilterSet):
    type = django_filters.AllValuesFilter()
    manufacturer = django_filters.AllValuesFilter()

    class Meta:
        model = Device
        fields = ['manufacturer', 'type']

    def __init__(self, *args, **kwargs):
        super(DeviceFilter, self).__init__(*args, **kwargs)

        # Add "Any" entry to choice fields.
        for name, f in self.filters.items():
            if isinstance(f, django_filters.ChoiceFilter):
                f.field.choices = tuple([
                    ("", "Any"),
                ] + list(f.field.choices))
Esempio n. 21
0
class ServiceFilter(CommonFieldsFilterset):
    name = django_filters.CharFilter(lookup_type='icontains')
    description = django_filters.CharFilter(lookup_type='icontains')
    category = django_filters.AllValuesFilter(lookup_type='exact')
    code = django_filters.CharFilter(lookup_type='exact')

    class Meta(object):
        model = Service
Esempio n. 22
0
class FacilityApprovalFilter(CommonFieldsFilterset):
    facility = django_filters.AllValuesFilter(lookup_type='exact')
    comment = django_filters.CharFilter(lookup_type='icontains')
    is_cancelled = django_filters.TypedChoiceFilter(choices=BOOLEAN_CHOICES,
                                                    coerce=strtobool)

    class Meta(object):
        model = FacilityApproval
Esempio n. 23
0
class ServiceRatingFilter(CommonFieldsFilterset):
    facility_service = django_filters.AllValuesFilter(lookup_type='exact')
    cleanliness = django_filters.TypedChoiceFilter(choices=BOOLEAN_CHOICES,
                                                   coerce=strtobool)
    attitude = django_filters.TypedChoiceFilter(choices=BOOLEAN_CHOICES,
                                                coerce=strtobool)
    will_return = django_filters.TypedChoiceFilter(choices=BOOLEAN_CHOICES,
                                                   coerce=strtobool)
    occupation = django_filters.CharFilter(lookup_type='icontains')
    comment = django_filters.CharFilter(lookup_type='icontains')
    service = django_filters.AllValuesFilter(name='facility_service__service',
                                             lookup_type='exact')
    facility = django_filters.AllValuesFilter(
        name='facility_service__facility', lookup_type='exact')

    class Meta(object):
        model = ServiceRating
Esempio n. 24
0
class InfrastructureFilter(CommonFieldsFilterset):
    name = django_filters.CharFilter(lookup_expr='icontains')
    description = django_filters.CharFilter(lookup_expr='icontains')
    category = django_filters.AllValuesFilter(lookup_expr='exact')
    code = django_filters.CharFilter(lookup_expr='exact')

    class Meta(CommonFieldsFilterset.Meta):
        model = Infrastructure
Esempio n. 25
0
class SampleFilter(django_filters.FilterSet):
    scientist = django_filters.ModelMultipleChoiceFilter(queryset=Scientist.objects.all(),widget=forms.CheckboxSelectMultiple)
    status = django_filters.AllValuesMultipleFilter(widget=forms.CheckboxSelectMultiple)
    genotype = django_filters.AllValuesFilter(widget=forms.Select)
    #organism =django_filters.CharFilter(widget=forms.Select)
    tissue_type = django_filters.AllValuesMultipleFilter(widget=forms.CheckboxSelectMultiple)
    class Meta:
        model = Sample
        fields = ['antibody','celltype','exptype','genotype','scientist','sample_id','status','flowlane','organism','tissue_type','treatment']
Esempio n. 26
0
class FilterDaily(django_filters.FilterSet):
    rooms = django_filters.AllValuesFilter(
        widget=Select(),
        lookup_expr='exact',
    )
    sleeping_places = django_filters.AllValuesFilter(
        widget=Select(),
        lookup_expr='exact',
    )
    district = django_filters.ModelChoiceFilter(
        widget=Select(), queryset=DailyDistrict.objects.all())

    class Meta:
        model = Daily
        fields = {
            'price': ['gt', 'lt'],
        }
        strict = STRICTNESS.RETURN_NO_RESULTS
Esempio n. 27
0
class OwnerFilter(CommonFieldsFilterset):
    name = django_filters.CharFilter(lookup_type='icontains')
    description = django_filters.CharFilter(lookup_type='icontains')
    abbreviation = django_filters.CharFilter(lookup_type='icontains')
    code = django_filters.NumberFilter(lookup_type='exact')
    owner_type = django_filters.AllValuesFilter(lookup_type='exact')

    class Meta(object):
        model = Owner
Esempio n. 28
0
class PhotoFilter(django_filters.FilterSet):
    gallery = django_filters.AllValuesFilter(
        field_name='gallery__title',
        label='Gallery',
        widget=django_filters.widgets.LinkWidget())

    class Meta:
        model = Photo
        fields = ['gallery']
Esempio n. 29
0
class CommunityFilter(CommonFieldsFilterset):
    name = django_filters.CharFilter(lookup_type='icontains')
    code = django_filters.NumberFilter(lookup_type='exact')
    ward = django_filters.AllValuesFilter(lookup_type='exact')
    constituency = django_filters.CharFilter(name='ward__constituency')
    county = django_filters.CharFilter(name='ward__constituency__county')

    class Meta(object):
        model = Community
Esempio n. 30
0
class PhysicalAddressFilter(CommonFieldsFilterset):
    town = django_filters.AllValuesFilter(lookup_type='exact')
    postal_code = django_filters.CharFilter(lookup_type='icontains')
    address = django_filters.CharFilter(lookup_type='icontains')
    nearest_landmark = django_filters.CharFilter(lookup_type='icontains')
    plot_number = django_filters.CharFilter(lookup_type='icontains')

    class Meta(object):
        model = PhysicalAddress