[英]python - object() takes no parameters error
I have following python classes. 我有以下python类。
class FileMaster(db.Entity):
id = PrimaryKey(int, auto = True)
description = Required(str)
filesource = Required(str)
createdby = Optional(int)
createddate = Optional(datetime.datetime)
updatedby = Optional(int)
updateddate = Optional(datetime.datetime)
filelists = Set('FileList')
class FileList(db.Entity):
id = PrimaryKey(int, auto = True)
filemaster = Required(FileMaster)
filelocation = Required(str)
createdby = Optional(int)
createddate = Optional(datetime.datetime)
updatedby = Optional(int)
updateddate = Optional(datetime.datetime)
transcripts = Set('Transcript')
The following line runs fine, 以下行运行正常,
filemst = FileMaster(description=desc, filesource = filesourcepath)
But the following line gives error "object() takes no parameters" 但是下面一行给出了错误“ object()不带参数”
filelist = FileList(filemaster=filemst, filelocation='test')
Any one can help me on this? 有人可以帮助我吗?
我不确定是什么问题,但是我通过删除数据库中的表并为类使用了不同的名称来解决了问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.