i am trying to assign a specialty for each doctor through admin panel i have created class doctor and it includes a reference field to class medical specialty but when i try to assign specialty to the doctor i get a medical specialty object instead of the name of the specialty
` class Doctor(Document, UserMixin):
name = StringField(required=True)
email = EmailField(required=True)
password = StringField(required=True)
role = StringField(required=True)
actual_role = StringField(
choices=['admin', 'doctor', 'patient'], required=True)
confirmed = BooleanField()
specialty = ReferenceField('MedicalSpecialty')`
class MedicalSpecialty(Document):
specialties = StringField()
class MedicalView(ModelView):
form_columns = ['specialties']
class DoctorView(ModelView):
form_columns = ['name', 'email', 'password',
'role', 'actual_role', 'confirmed', 'specialty']
column_searchable_list = (
'name', 'email')
admin.add_view(DoctorView(
Doctor, endpoint='Doctor'))
admin.add_view(MedicalView(MedicalSpecialty, endpoint='MedicalSpecialty'))
[![enter image description here][1]][1]
[![enter image description here][2]][2]
[![enter image description here][5]][5]
[![enter image description here][6]][6]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…