2👍
✅
This seems to be a problem in the widget used in the Admin interface, not directly in your Training_unit.
Check your Trainint_unit Admin model, the problem is probably there. Maybe you use a TabularInline for your admin model so that other things (like a Date widget) is loaded?
3👍
You are looking to wrong place. This model __str__
is ok.
Try to click on the
File "C:\Python34\lib\site-packages\django\forms\forms.py" in as_widget
599. return force_text(widget.render(name, self.value(), attrs=attrs))
You will see locals variables at this line, and name
should point to the actual problematic field.
Source:stackexchange.com