diff --git a/pulp_container/app/modelresource.py b/pulp_container/app/modelresource.py index dfd7e8f85..801d330e0 100644 --- a/pulp_container/app/modelresource.py +++ b/pulp_container/app/modelresource.py @@ -13,6 +13,14 @@ ) +class BinaryWidget(widgets.Widget): + def clean(self, value, row=None, **kwargs): + return bytes.fromhex(value) + + def render(self, value, obj=None): + return value.hex() + + class ContainerRepositoryResource(RepositoryResource): """ A resource for importing/exporting repositories of the sync type @@ -65,6 +73,11 @@ class BlobResource(BaseContentResource): Resource for import/export of blob entities """ + data = fields.Field( + column_name="data", + attribute="data", + widget=BinaryWidget() + ) def set_up_queryset(self): """ :return: Blobs specific to a specified repo-version.