swh.deposit.api.utils module

class swh.deposit.api.utils.DefaultPagination[source]

Bases: PageNumberPagination

page_size = 100
page_size_query_param = 'page_size'
class swh.deposit.api.utils.StatusDetailField(*args, **kwargs)[source]

Bases: _UnvalidatedField

status_detail field is a dict, we want a simple message instead. So, we reuse the convert_status_detail from deposit_status endpoint to that effect.

When a field is instantiated, we store the arguments that were used, so that we can present a helpful representation of the object.

to_representation(value)[source]

Transform the outgoing native value into primitive data.

class swh.deposit.api.utils.DepositSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

When a field is instantiated, we store the arguments that were used, so that we can present a helpful representation of the object.

class Meta[source]

Bases: object

model

alias of Deposit

fields = '__all__'