示例#1
0
文件: models.py 项目: kotenev/taska
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()
示例#2
0
文件: models.py 项目: kotenev/taska
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()