tmserver.model package

Module contents

Submodules

tmserver.model.utils module

Utility functions for dealing with data models.

tmserver.model.utils.decode_pk(pk_str)

Decode a hashed database ID so that it can be used when formulating SQL queries.

Parameters:

pk_str : str

hashed database ID

Returns

——

int

original database ID

Raises:

ValueError

when the hashed ID can’t be decoded.

tmserver.model.utils.encode_pk(pk)

Encode a database id as a string such that it is not directly visible to the client

Parameters:

pk : int

original database ID

Returns

——

str

hashed database ID