我不太清楚问题出在哪里,可能是语法问题,也可能是关于django返回的querysets的一些问题,我不太清楚。在
Class1(models.Model):
...
def __add__(self,other)
return other + ({'attribute': value}, ..)
我希望类之间的加法将返回一个包含所有对象的元组并放入其中。 因此,我不得不避免sum()函数,因为它在寻找整数。在
^{2}$我得到一个没有初始值的空序列的TypeError:reduce()。在
UPDATE: My lists were empty. I resolved that and received this error
TypeError: unsupported operand type(s) for +: 'dict' and 'dict' But shouldn't it be appending the tuple and not the dicts?
有什么想法吗?我是不是完全错了?在
谢谢
你的过滤器必须只是没有返回结果。我刚刚测试了你的代码,它很有用。在
相关问题 更多 >
编程相关推荐