dmptrluke / django-markdownfield

A simple custom field for Django that can safely render Markdown and store it in the database.
MIT License
43 stars 13 forks source link

Issue with forms.ModelForm #6

Closed shiggins21 closed 3 years ago

shiggins21 commented 3 years ago

I have a simple model that I only need to have this markdown field. I set up everything like was mentioned in the README, but when I go to run the migration, I constantly get this error:

File "/usr/local/lib/python3.8/site-packages/markdownfield/models.py", line 71, in formfield if defaults['widget'] == admin_widgets.AdminTextareaWidget: KeyError: 'widget'

It seems like the 'widget' property isn't defined on defaults and this always errors out. Any thoughts on how to fix this?

shiggins21 commented 3 years ago

Actually, I was able to solve this by passing in a specified widget (that would then be overridden by the MDE widget). Closing issue.