- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
在一些 set 操作中,我在 Python 中遇到了这个错误:
TypeError: unhashable type: 'InstrumentedList'
什么是 Python 中的 InstrumentedList
?我只找到了一些与 SQLAlchemy 相关的引用资料。这是列表的 SQLAlchemy 实现还是什么?
顺便说一下,它发生在做的时候:
set(self.some_list)
在哪里
print type(self.some_list) # <type 'list'>
最佳答案
是的,SQLAlchemy 使用它来实现一个类似列表的对象,它知道相关对象对对象的插入和删除(通过一对多和多对多关系)。
关于python - 什么是 Python 中的 InstrumentedList?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6654613/
目前我有一个 InstrumentedList这代表了我的 Pyramid 应用程序中的一对多关系。关系的构建方式如下: Class project: submissions = relations
快速总结:我想在 SQLAlchemy 中有一个有序的地址列表。但是当我提交时,我的列表顺序会改变。为什么会发生这种情况,我该如何改变它? 详细解释: 我从附加到用户对象的地址列表开始。 然后我将“地
我有这些表格: class Thing(Base): __tablename__ = 'thing' id = Column(Integer, primary_key=True) cl
在一些 set 操作中,我在 Python 中遇到了这个错误: TypeError: unhashable type: 'InstrumentedList' 什么是 Python 中的 Instrum
我有以下 3 个类(class): class Resource: id = Column(Integer, primary_key=True) path = Column(Text)
我想动态获取 InstrumentedList 实例使用的 SQLAlchemy 映射器类。 我有一个 1-M ParentClass-ChildClass(我们称列为 myRelation),par
在呈现 html 模板时,未正确传递 minutes_id。它抛出错误:“AttributeError:‘InstrumentedList’对象没有属性‘get’”。我不确定如何解决这个问题。 这行代
我正在创建一个销售点应用程序,具有典型的数据层次结构:Company->branches->Sales->SaleData,这是模型定义(请注意,User 模型已经准备好并作为 flask-login
我想为客户端的 subscribed_users 分页,但我收到一条错误消息: cl = Client.query.filter_by(family='John').first() cl.subscr
我是一名优秀的程序员,十分优秀!