Пример #1
0
class ObjectChangeFilterForm(BootstrapMixin, forms.Form):
    model = ObjectChange
    q = forms.CharField(required=False, label="Search")
    time_after = forms.DateTimeField(label="After",
                                     required=False,
                                     widget=DateTimePicker())
    time_before = forms.DateTimeField(label="Before",
                                      required=False,
                                      widget=DateTimePicker())
    action = forms.ChoiceField(
        choices=add_blank_choice(ObjectChangeActionChoices),
        required=False,
        widget=StaticSelect2(),
    )
    user_id = DynamicModelMultipleChoiceField(
        queryset=get_user_model().objects.all(),
        required=False,
        label="User",
        widget=APISelectMultiple(api_url="/api/users/users/", ),
    )
    changed_object_type_id = DynamicModelMultipleChoiceField(
        queryset=ContentType.objects.all(),
        required=False,
        label="Object Type",
        widget=APISelectMultiple(api_url="/api/extras/content-types/", ),
    )
Пример #2
0
class RelationshipFilterForm(BootstrapMixin, forms.Form):
    model = Relationship

    type = forms.MultipleChoiceField(choices=RelationshipTypeChoices,
                                     required=False,
                                     widget=StaticSelect2Multiple())

    source_type = DynamicModelMultipleChoiceField(
        queryset=ContentType.objects.all(),
        required=False,
        display_field="display_name",
        label="Source Type",
        widget=APISelectMultiple(api_url="/api/extras/content-types/", ),
    )

    destination_type = DynamicModelMultipleChoiceField(
        queryset=ContentType.objects.all(),
        required=False,
        display_field="display_name",
        label="Destination Type",
        widget=APISelectMultiple(api_url="/api/extras/content-types/", ),
    )
Пример #3
0
class RelationshipAssociationFilterForm(BootstrapMixin, forms.Form):
    model = RelationshipAssociation

    relationship = DynamicModelMultipleChoiceField(
        queryset=Relationship.objects.all(),
        to_field_name="slug",
        required=False,
    )

    source_type = DynamicModelMultipleChoiceField(
        queryset=ContentType.objects.all(),
        required=False,
        display_field="display_name",
        label="Source Type",
        widget=APISelectMultiple(api_url="/api/extras/content-types/", ),
    )

    destination_type = DynamicModelMultipleChoiceField(
        queryset=ContentType.objects.all(),
        required=False,
        display_field="display_name",
        label="Destination Type",
        widget=APISelectMultiple(api_url="/api/extras/content-types/", ),
    )
Пример #4
0
class JobResultFilterForm(BootstrapMixin, forms.Form):
    model = JobResult
    q = forms.CharField(required=False, label="Search")
    # FIXME(glenn) Filtering by obj_type?
    name = forms.CharField(required=False)
    user = DynamicModelMultipleChoiceField(
        queryset=get_user_model().objects.all(),
        required=False,
        label="User",
        widget=APISelectMultiple(api_url="/api/users/users/", ),
    )
    status = forms.ChoiceField(
        choices=add_blank_choice(JobResultStatusChoices),
        required=False,
        widget=StaticSelect2(),
    )