AttributeError:“UUID”对象没有属性“replace”

2024-06-16 11:12:40 发布

您现在位置:Python中文网/ 问答频道 /正文

作为参考,我主要使用了这两种资源

AttributeError: 'UUID' object has no attribute 'replace' when using backend-agnostic GUID typehttps://websauna.org/docs/narrative/modelling/models.html#uuid-primary-keys

这似乎表明这个问题已经解决了,尽管我似乎不能让它发挥作用。在

我的错误与上面的SO帖子中的错误相同,但为了彻底起见:

 File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/uuid.py", line 137, in __init__
    hex = hex.replace('urn:', '').replace('uuid:', '')
AttributeError: 'UUID' object has no attribute 'replace'

我的模型如下:

^{pr2}$

有其他的工作吗?在


Tags: nobackendobjectuuid错误attribute资源replace