djongo
djongo copied to clipboard
error making admin form for EmbeddedField
the EmbeddedField got error when displaying form in admin panel
Python script
venv/lib/python3.8/site-packages/django/forms/models.py", line 86, in model_to_dict
class MetaData(models.Model):
src_url = models.CharField(max_length=200)
sp_data = models.CharField(max_length=200)
dir = models.CharField(max_length=200)
class Meta:
abstract = True
class Artist(models.Model):
_id = models.ObjectIdField()
name = models.CharField(max_length=200)
meta_data = models.EmbeddedField(model_container=MetaData, model_form_class=MetaDataForm)
status = models.SmallIntegerField(default=None)
Traceback
Error during template rendering In template /home/hossy/Documents/projects/noteabi/venv/lib/python3.8/site-packages/django/contrib/admin/templates/admin/includes/fieldset.html, error at line 19
'dict' object has no attribute '_meta'
Do you solve your issue?
Hi, I'm facing the same problem. I embed the same way as described above (author on blogpost) and I run in the same error.
Do you solve your issue?
No i haven't
But I think we can override the admin/templates/admin/includes/fieldset.html template and solve the error
Maybe a bit late, but a very smart person did a fork and fixed it! https://github.com/bslocombe/djongo