Exemplo n.º 1
0
    def _create_assets_from_draft(
            self, drafts: List[types.AssetDraft]) -> List[types.Asset]:
        assets: List[types.Asset] = []
        for draft in drafts:
            custom: Optional[types.CustomFields] = None
            if draft.custom:
                custom = custom_fields_from_draft(self._storage, draft.custom)

            asset = types.Asset(
                sources=draft.sources,
                name=draft.name,
                description=draft.description,
                tags=draft.tags,
                custom=custom,
                key=draft.key,
            )
            assets.append(asset)
        return assets
Exemplo n.º 2
0
 def post_load(self, data, **kwargs):
     return types.Asset(**data)
 def post_load(self, data):
     return types.Asset(**data)