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
class Feed(Document):
…
thumbnail_url = URLField(required=False, default=u'')
…
…
class FeedAdminForm(DocumentForm):
class Meta:
model = Feed
It crashes, but only in the Django admin.
I use Django 1.6.
This happens whether default=u'' is present or not. Django keeps wanting to convert u'' to None and it crashes.
If the
DocumentForm
has an optionalStringField
with no data value specified for it on the form instance, it will fail with;This is because on documents.py#L439, a call is being made to
validate()
on the model field which in raises an exception.Mongoengine handles this in
save()
by simply removing the field duringto_mongo()
as seen in mongoengine:document.py#L248.Here's a few ideas on how it could be fixed;
.validate()
from being called on fields which are not specified indata
_get_validation_exclusions()
to support excluding this conditionAll of the above could have cascading consequences, and it's not clear which is the correct way forward.
Thoughts?
The text was updated successfully, but these errors were encountered: