djongo icon indicating copy to clipboard operation
djongo copied to clipboard

EmbeddedField with Django Admin

Open brunowego opened this issue 4 years ago • 19 comments

One line description of the issue

I'm trying use EmbeddedField. Perhaps an I do a mistake?

Python script

from djongo import models


class Language(models.Model):
    CODE_LANG_CHOICES = (
        ('en', 'English'),
        ('pt', 'Portuguese'),
    )

    DIRECTION_CHOICES = (
        ('ltr', 'Left-to-right'),
        ('rtl', 'Right-to-left'),
    )

    code = models.CharField(max_length=2, choices=CODE_LANG_CHOICES, default='en')
    direction = models.CharField(max_length=3, choices=DIRECTION_CHOICES, default='ltr')

    def __str__(self):
        return f'{self.code}'

    class Meta:
        abstract = True


class Campaign(models.Model):
    name = models.TextField()
    language = models.EmbeddedField(model_container=Language)

Traceback

Screen Shot 2020-10-29 at 5 34 40 PM
Django==2.2.16
sqlparse==0.2.4
git+https://github.com/nesdis/djongo.git@master#egg=djongo
djangorestframework==3.12.1

Python 3.6.12 MongoDB 3.6

brunowego avatar Oct 29 '20 20:10 brunowego

Related https://github.com/nesdis/djongo/issues/115

brunowego avatar Oct 29 '20 21:10 brunowego

I think this post at Google Group are related too.

brunowego avatar Oct 30 '20 01:10 brunowego

Bounty of $15 at https://www.bountysource.com/issues/93727997-embeddedfield-with-django-admin

brunowego avatar Oct 30 '20 21:10 brunowego

Exists a bug in 1.3.3, after downgrading to 1.3.1 works.

brunowego avatar Nov 01 '20 18:11 brunowego

The bounty continues for those who resolve the issue in version 1.3.3.

brunowego avatar Nov 01 '20 18:11 brunowego

@brunowego The Bounty is closed now, did you solve this?

ronpetit avatar Nov 03 '20 19:11 ronpetit

@brunowego I will reopen. Have a problem with the version 1.3.3.

brunowego avatar Nov 03 '20 19:11 brunowego

Exists a bug in 1.3.3, after downgrading to 1.3.1 works.

What do u mean with 1.3.1? Version of what? thx

drandredev avatar Feb 05 '21 20:02 drandredev

@drandredev put in your requirements.txt the version of 1.3.1 of Djongo.

brunowego avatar Feb 08 '21 11:02 brunowego

Same problem. Running 1.3.3 djongo, 4.2 mongodb, 3.0.3 Django

hyough avatar May 25 '21 07:05 hyough

Same problem here too. I get Abstract models cannot be instantiated. on the admin site.

Fire-Hound avatar Jun 01 '21 20:06 Fire-Hound

Downgrading djongo to 1.3.1 does not help me as my project is on Django 3.1.12, and djongo 1.3.1 requires Django version<2, Please suggest some fix.

mohammed-muzzammil avatar Jun 25 '21 12:06 mohammed-muzzammil

I still have this issue and am running djongo 1.3.6.

hyough avatar Jul 15 '21 10:07 hyough

@brunowego This is occurring for me except with lists using djongo 1.3.6. My version of django (3.1.2) won't allow for me to downgrade djongo. Is anyone on this, yet?

CoryKleiser avatar Nov 12 '21 16:11 CoryKleiser

Yeah, I have the same issue

Sergi-Aguilar avatar Jan 07 '22 20:01 Sergi-Aguilar

Same Issue now, any fix?

Gap6769 avatar Dec 13 '22 17:12 Gap6769

Same Issue, any fixes??

LaxmanMaharjan avatar Jun 13 '23 11:06 LaxmanMaharjan

bruh

ronfromhp avatar Sep 25 '23 23:09 ronfromhp