Exemplo n.º 1
0
def __generate_requestresponse_hash(sender, instance, created, *args,
                                    **kwargs):
    '''This method uses the post_save signal to automatically generate unique public hashes to be used when referencing an request response.
    '''
    if created:
        instance.hash = createHash(instance.id)
        instance.save()
Exemplo n.º 2
0
def __generate_result_hash(sender, instance, created, *args, **kwargs):
    '''This method uses the post_save signal to automatically generate unique public hashes to be used when referencing an result.
    '''
    if not isinstance(instance, Result):
        return

    if created:
        instance.hash = createHash(instance.id)
        instance.ttype = instance.type()
        instance.save()