You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I finally traced it down to adding "null=True" to my list of attributes in the models.py file. If I remove that entry I can see the form fine, but if I add it back in the "form.as_p" call returns nothing in the template.
Looking in the debugger the form object looks different too. The text representation is the python default object ID when the form is broken. When it would display I see the HTML code that would get output for the items in my form.
Now I'm not sure this will show up in the example above, but the code change I'd make would be...
categories = CategoryField()
becomes...
categories = CategoryField(null=True)
I had added that to work around existing documents that didn't have my new ListField value. I assumed the model verification would fail somewhere if there were existing documents without a value in a field that can't be null or blank.
My app is really long and I'm hoping this is enough to reproduce the issue.
The text was updated successfully, but these errors were encountered:
I've been having a ton of trouble getting a ListField to work, even after following the very useful example at https://gist.github.com/jonashaag/1200165
I finally traced it down to adding "null=True" to my list of attributes in the models.py file. If I remove that entry I can see the form fine, but if I add it back in the "form.as_p" call returns nothing in the template.
Looking in the debugger the form object looks different too. The text representation is the python default object ID when the form is broken. When it would display I see the HTML code that would get output for the items in my form.
Now I'm not sure this will show up in the example above, but the code change I'd make would be...
categories = CategoryField()
becomes...
categories = CategoryField(null=True)
I had added that to work around existing documents that didn't have my new ListField value. I assumed the model verification would fail somewhere if there were existing documents without a value in a field that can't be null or blank.
My app is really long and I'm hoping this is enough to reproduce the issue.
The text was updated successfully, but these errors were encountered: