MCPcopy
hub / github.com/apache/caldera / ObjectiveSchema

Class ObjectiveSchema

app/objects/c_objective.py:10–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8
9
10class ObjectiveSchema(ma.Schema):
11
12 class Meta:
13 unknown = ma.EXCLUDE
14
15 id = ma.fields.String()
16 name = ma.fields.String()
17 description = ma.fields.String()
18 goals = ma.fields.List(ma.fields.Nested(GoalSchema))
19 percentage = ma.fields.Float(dump_only=True)
20
21 @ma.pre_load
22 def remove_properties(self, data, **_):
23 data.pop('percentage', None)
24 return data
25
26 @ma.post_load
27 def build_objective(self, data, **kwargs):
28 return None if kwargs.get('partial') is True else Objective(**data)
29
30
31class Objective(FirstClassObjectInterface, BaseObject):

Callers 3

OperationSchemaClass · 0.90
ObjectiveClass · 0.85

Calls

no outgoing calls

Tested by 1