嘿,我正在尝试返回一组对象,这些对象属于登录用户关注的“朋友”,并且位于特定的地理空间内。但是我得到了这个错误: AttributeError: 'int' object has no attribute 'cafe_name' views.py def get_friends(request199, in <listcomp>
[cafe.cafe_name, cafe.cafe_address, cafe.geolocation.y, caf
我有两个模型概况和事件。我希望将用户创建的事件数量保存到用户配置文件中,这样即使删除了事件,记录也会保留在用户配置文件中。 user = models.OneToOneField(User, on_delete=models.CASCADE) user = models.ForeignKey(User, related_name='seller')
我还没有解决搬进一个不存在的房间的问题,我确信我的代码相当糟糕,但如下所示:
>>> ================================ RESTART ===========Spencer\Documents\Python\Game.py", line 25, in <module>AttributeError: 'int' object has no attrib
Computing\Project\Python\GUI Maths Quiz.py", line 178, in submit_answerAttributeError: 'int' object has no attribute 'get'
我正在尝试做一个益智游戏,我使用AnswerEntry输入框从用户那里获得输入,但是它告诉我对象没有get属性,请帮助!
同一个模型有两个外键有问题,当我发布数据时,我得到了错误"AttributeError:'int‘object没有属性'pk'“等等。\env\lib\site-packages\rest_framework\relations.py", line 273, in to_representationAttributeError: 'int' object has no attribut
我建立了一个红绿灯检测模型,其他一切都很好。但当我试图直观地显示预测和基本事实时,它给了我一个类似上面的错误。我猜预测函数不知何故是错的。有人能帮上忙吗?下面是代码。 fig = plt.figure(figsize=(10, 10)) for i in range(0, 1000, 100): prediction = model.predict(i)
plt.