Closed xiaojin20 closed 2 months ago
Bro if you can't even format your code how do you expect me to care enough to investigate...
But the issue is that you are using a field named "a.update". Model.update
is a method, so you must not name your fields update
(or any of the other methods on Model
).
File "/usr/local/lib/python3.11/dist-packages/robyn/router.py", line 145, in inner_handler handler(*args, kwargs), ^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/www/website.py", line 42, in updatearticle dbapi.updatearticle(1,1,"python sql","标题","updateuser","简介","内容") File "/root/www/dbapi.py", line 19, in updatearticle a.save() File "/usr/local/lib/python3.11/dist-packages/peewee.py", line 6938, in save rows = self.update(field_dict).where(self._pk_expr()).execute() ^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'str' object is not callable
TypeError: 'str' object is not callable?????
文章数据表
class Articles(BaseModel): tid = IntegerField(default=0) title = CharField() author= CharField(default='admin') createt = CharField(default=datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')) update = CharField(default='0') status = IntegerField(default=0) # 显示控制,或其他 abstr = CharField() content = TextField()
`def updatearticle(aidd,tidd,tagss,titlee,authorr,abstrr,contentt):