'ModelFormOptions' object has no attribute 'label'

501 views
Skip to first unread message

Lachlan Musicman

unread,
Aug 21, 2017, 2:11:29 AM8/21/17
to django...@googlegroups.com
Hi All,

I'm seeing this error when I start my uwsgi



> Exception Type: AttributeError Exception Value:
>
> 'ModelFormOptions' object has no attribute 'label'

> Exception Location: /opt/virtualenvs/traceback/lib/python3.4/site-packages/django/forms/models.py in _get_foreign_key, line 1023




But I can't find anything in the documents that might suggest what's causing it, and my google fu is failing me. Running Centos 7, py 3.4 from EPEL. Everything in a virtualenv

Was working until I implemented inlineformset_factory with:

ChemoRegimeFormSet = inlineformset_factory(Patient, ChemoRegime, extra=1)

Patient has a m2m connection to ChemoType, which is through ChemoRegime.

(ie, ChemoRegime has the FK to Patient, and an FK to ChemoType)

What am I doing wrong, how can I fix it?

cheers
L.


------
"The antidote to apocalypticism is apocalyptic civics. Apocalyptic civics is the insistence that we cannot ignore the truth, nor should we panic about it. It is a shared consciousness that our institutions have failed and our ecosystem is collapsing, yet we are still here — and we are creative agents who can shape our destinies. Apocalyptic civics is the conviction that the only way out is through, and the only way through is together. "

Greg Bloom @greggish https://twitter.com/greggish/status/873177525903609857

Anup Yadav

unread,
Mar 1, 2018, 4:46:58 PM3/1/18
to Django users
Could you solve this issue? May I know what was the issue? I'm facing this issue right now.
Reply all
Reply to author
Forward
0 new messages