File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2103,6 +2103,11 @@ class ProductSerializer(serializers.ModelSerializer):
21032103 findings_count = serializers .SerializerMethodField ()
21042104 findings_list = serializers .SerializerMethodField ()
21052105
2106+ business_criticality = serializers .ChoiceField (choices = Product .BUSINESS_CRITICALITY_CHOICES , allow_blank = True )
2107+ platform = serializers .ChoiceField (choices = Product .PLATFORM_CHOICES , allow_blank = True )
2108+ lifecycle = serializers .ChoiceField (choices = Product .LIFECYCLE_CHOICES , allow_blank = True )
2109+ origin = serializers .ChoiceField (choices = Product .ORIGIN_CHOICES , allow_blank = True )
2110+
21062111 tags = TagListSerializerField (required = False )
21072112 product_meta = ProductMetaSerializer (read_only = True , many = True )
21082113
Original file line number Diff line number Diff line change @@ -1423,10 +1423,10 @@ class ApiProductFilter(DojoFilter):
14231423 name = CharFilter (lookup_expr = "icontains" )
14241424 name_exact = CharFilter (field_name = "name" , lookup_expr = "iexact" )
14251425 description = CharFilter (lookup_expr = "icontains" )
1426- business_criticality = CharFilter ( method = custom_filter , field_name = "business_criticality" )
1427- platform = CharFilter ( method = custom_filter , field_name = "platform" )
1428- lifecycle = CharFilter ( method = custom_filter , field_name = "lifecycle" )
1429- origin = CharFilter ( method = custom_filter , field_name = "origin" )
1426+ business_criticality = MultipleChoiceFilter ( choices = Product . BUSINESS_CRITICALITY_CHOICES )
1427+ platform = MultipleChoiceFilter ( choices = Product . PLATFORM_CHOICES )
1428+ lifecycle = MultipleChoiceFilter ( choices = Product . LIFECYCLE_CHOICES )
1429+ origin = MultipleChoiceFilter ( choices = Product . ORIGIN_CHOICES )
14301430 # NumberInFilter
14311431 id = NumberInFilter (field_name = "id" , lookup_expr = "in" )
14321432 product_manager = NumberInFilter (field_name = "product_manager" , lookup_expr = "in" )
You can’t perform that action at this time.
0 commit comments