*: add model_name to TypeCreate API to pass to forms
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
4add0bbe86
commit
67240fb9ad
|
@ -93,6 +93,7 @@ class PropertyMappingViewSet(
|
|||
"description": subclass.__doc__,
|
||||
# pyright: reportGeneralTypeIssues=false
|
||||
"component": subclass().component,
|
||||
"model_name": subclass._meta.model_name
|
||||
}
|
||||
)
|
||||
return Response(TypeCreateSerializer(data, many=True).data)
|
||||
|
|
|
@ -78,6 +78,7 @@ class ProviderViewSet(
|
|||
"name": subclass._meta.verbose_name,
|
||||
"description": subclass.__doc__,
|
||||
"component": subclass().component,
|
||||
"model_name": subclass._meta.model_name
|
||||
}
|
||||
)
|
||||
data.append(
|
||||
|
|
|
@ -81,6 +81,7 @@ class SourceViewSet(
|
|||
"name": subclass._meta.verbose_name,
|
||||
"description": subclass.__doc__,
|
||||
"component": component,
|
||||
"model_name": subclass._meta.model_name
|
||||
}
|
||||
)
|
||||
return Response(TypeCreateSerializer(data, many=True).data)
|
||||
|
|
|
@ -48,6 +48,7 @@ class TypeCreateSerializer(PassiveSerializer):
|
|||
name = CharField(required=True)
|
||||
description = CharField(required=True)
|
||||
component = CharField(required=True)
|
||||
model_name = CharField(required=True)
|
||||
|
||||
|
||||
class CacheSerializer(PassiveSerializer):
|
||||
|
|
|
@ -157,6 +157,7 @@ class EventViewSet(ReadOnlyModelViewSet):
|
|||
"name": name,
|
||||
"description": "",
|
||||
"component": value,
|
||||
"model_name": ""
|
||||
}
|
||||
)
|
||||
return Response(TypeCreateSerializer(data, many=True).data)
|
||||
|
|
|
@ -80,6 +80,7 @@ class StageViewSet(
|
|||
"name": subclass._meta.verbose_name,
|
||||
"description": subclass.__doc__,
|
||||
"component": subclass().component,
|
||||
"model_name": subclass._meta.model_name
|
||||
}
|
||||
)
|
||||
data = sorted(data, key=lambda x: x["name"])
|
||||
|
|
|
@ -82,6 +82,7 @@ class ServiceConnectionViewSet(
|
|||
"name": subclass._meta.verbose_name,
|
||||
"description": subclass.__doc__,
|
||||
"component": subclass().component,
|
||||
"model_name": subclass._meta.model_name
|
||||
}
|
||||
)
|
||||
return Response(TypeCreateSerializer(data, many=True).data)
|
||||
|
|
|
@ -108,6 +108,7 @@ class PolicyViewSet(
|
|||
"name": subclass._meta.verbose_name,
|
||||
"description": subclass.__doc__,
|
||||
"component": subclass().component,
|
||||
"model_name": subclass._meta.model_name
|
||||
}
|
||||
)
|
||||
return Response(TypeCreateSerializer(data, many=True).data)
|
||||
|
|
|
@ -63,6 +63,7 @@ class EmailStageViewSet(ModelViewSet):
|
|||
"name": value,
|
||||
"description": label,
|
||||
"component": "",
|
||||
"model_name": "",
|
||||
}
|
||||
)
|
||||
return Response(TypeCreateSerializer(choices, many=True).data)
|
||||
|
|
|
@ -14771,6 +14771,7 @@ definitions:
|
|||
- name
|
||||
- description
|
||||
- component
|
||||
- model_name
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
|
@ -14785,6 +14786,10 @@ definitions:
|
|||
title: Component
|
||||
type: string
|
||||
minLength: 1
|
||||
model_name:
|
||||
title: Model name
|
||||
type: string
|
||||
minLength: 1
|
||||
EventTopPerUser:
|
||||
required:
|
||||
- application
|
||||
|
|
Reference in a new issue