以上错误是运行点击添加数据等报异常,全是度年解决,并记录解决方法
1.报异常 ‘某个字段类型 ‘ object has no attribute ‘rel‘,点击报异常的地方,把.rel 修改为.remote_field
2.报异常'ManyToOneRel' object has no attribute 'to' 点击报异常的地方,self.add_url, (_('Create New %s') % self.rel.to._meta.verbose_name), name,修改为self.add_url, (_('Create New %s') % self.rel), name,
3.报异常 Exception: Relate Lookup field must a related field 点击报异常的地方,修改 xadminutil.py 中 495行
return (hasattr(field, 'rel') and field.rel != None) or is_related_field(field)
修改为
return (hasattr(field, 'remote_field') and field.remote_field != None) or is_related_field(field)