我有一个使用以下代码创建的类
class exp(osv.osv):
_name = "sim.exp"
_description = "xxx"
_columns = {
'building': fields.many2one('sim.buildings','Building',required=True,ondelete='cascade'),
'owner': fields.many2one('sim.student','Name of Owner',required=True,ondelete='cascade'),
}
exp()
我对该领域有一个特定的问题,owner
由于某种原因让我回到了该regnum
领域,我希望取回该student_name
领域
我的sim.student
课程如下所示
class student(osv.osv):
_name = "sim.student"
_description = "xxx"
_columns = {
'student_name': fields.char('Name',size=256,required=True),
'regnum': fields.char('Registration Number',size=256,required=True),
'father_name': fields.char('Last Name',size=256),
'gender':fields.selection([('male','Male'),('female','Female')],'Gender'),
'contact_no':fields.char('e-mail',size=256),
'building': fields.many2one('sim.buildings','Consorcio',required=True,ondelete='cascade'),
}
student()
有什么办法可以具体得到student_name
吗?
任何正确方向的提示将不胜感激!