Skip to content
Advertisement

Issue with class declaration in python. Two classes with fields of each other

My code is something like this:

JavaScript

and i have NameError: name ‘className2’ is not defined. I don’t know if there is a declaration in python like in c++, and you can call classes in any order. Please help me…

full code:

JavaScript

field Speciality.abit is calls AdmissionList and field AdmissionList.speciality calls Speciality.

Advertisement

Answer

I think i avoid that problem by adding quotes into class call

JavaScript
JavaScript
Advertisement