Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError #5

Open
ghost opened this issue Apr 10, 2020 · 2 comments
Open

AttributeError #5

ghost opened this issue Apr 10, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 10, 2020

when I use the django-mongoengine-filter just like I used in DRF,but there raise some errors:

class PersonSerializer(mongoserializers.DocumentSerializer):
    class Meta:
        model = Person
        fields = ["name"]

AttributeError: 'QuerySet' object has no attribute 'model'

@barseghyanartur
Copy link
Owner

Could you provide a full example? Please, mention versions (Mongo, MongoEngine, Django, DRF, etc). Dumped requirements are more than welcome too.

@jesusch
Copy link

jesusch commented May 27, 2020

the problem using django-filter/django-mongoengine-filter and 'QuerySet' object has no attribute 'model' is somewhere totally different.
@liuhuan086 is subclassing mongoengine.document instead of django_mongoengine.document (which maps self.model to self._document)

see: https://github.com/MongoEngine/django-mongoengine/blob/master/django_mongoengine/queryset.py#L26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants