Player.auth_hash and Objective.hash are random fields that should be occupied with a random hash (token_hex(16)) when created. Right now this has to be called explicitly (set_auth_hash() and set_hash() respectively). Because this is prone to programmer error, I'd rather the hash is automaticly generated at creation of the entity.
The db.Column(default=token_hex(16)) method does not work; SqlAlchemy seems to run this function only once for each time the server starts, resulting in duplicate hashes.
Player.auth_hash and Objective.hash are random fields that should be occupied with a random hash (token_hex(16)) when created. Right now this has to be called explicitly (set_auth_hash() and set_hash() respectively). Because this is prone to programmer error, I'd rather the hash is automaticly generated at creation of the entity.
The db.Column(default=token_hex(16)) method does not work; SqlAlchemy seems to run this function only once for each time the server starts, resulting in duplicate hashes.
Player.auth_hash and Objective.hash are random fields that should be occupied with a random hash (token_hex(16)) when created. Right now this has to be called explicitly (set_auth_hash() and set_hash() respectively). Because this is prone to programmer error, I'd rather the hash is automaticly generated at creation of the entity.
The db.Column(default=token_hex(16)) method does not work; SqlAlchemy seems to run this function only once for each time the server starts, resulting in duplicate hashes.