safe_eth.eth.django package

Subpackages

Submodules

safe_eth.eth.django.admin module

class safe_eth.eth.django.admin.AdvancedAdminSearchMixin

Bases: object

Use database indexes when using exact search instead of converting everything to text before searching

get_search_results(request, queryset, search_term)

Return a tuple containing a queryset to implement the search and a boolean indicating if the results may contain duplicates.

This function was modified from Django original get_search_results to allow exact search that uses database indexes

safe_eth.eth.django.filters module

safe_eth.eth.django.forms module

safe_eth.eth.django.models module

safe_eth.eth.django.serializers module

class safe_eth.eth.django.serializers.EthereumAddressField(*args, **kwargs)

Bases: Field

Ethereum address checksumed https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md

to_internal_value(data)

Transform the incoming primitive data into a native value.

to_representation(obj)

Transform the outgoing native value into primitive data.

class safe_eth.eth.django.serializers.HexadecimalField(*args, **kwargs)

Bases: Field

Serializes hexadecimal values starting by 0x. Empty values should be None or just 0x.

default_error_messages
to_internal_value(data)

Transform the incoming primitive data into a native value.

to_representation(obj)

Transform the outgoing native value into primitive data.

class safe_eth.eth.django.serializers.Sha3HashField(*args, **kwargs)

Bases: HexadecimalField

class safe_eth.eth.django.serializers.SignatureSerializer(*args, **kwargs)

Bases: Serializer

class safe_eth.eth.django.serializers.TransactionResponseSerializer(*args, **kwargs)

Bases: Serializer

Use chars to avoid problems with big ints (i.e. JavaScript)

get_fields()

Returns a dictionary of {field_name: field_instance}.

class safe_eth.eth.django.serializers.TransactionSerializer(*args, **kwargs)

Bases: Serializer

get_fields()

Returns a dictionary of {field_name: field_instance}.

class safe_eth.eth.django.serializers.Uint32Field(*args, **kwargs)

Bases: DecimalField

class safe_eth.eth.django.serializers.Uint96Field(*args, **kwargs)

Bases: DecimalField

safe_eth.eth.django.validators module

safe_eth.eth.django.validators.validate_address(address: str)
safe_eth.eth.django.validators.validate_checksumed_address(address: str)

Module contents