Custom Page Manager from queryset not working
See original GitHub issueI can’t make things work just using the sample code in the guide here
Please note there is an error in the sample code: there is a missing “()” at the end of this lineobjects = PageManager.from_queryset(EventPageQuerySet)
I initially had the problem while working with wagtail_modeltranslation (see more at infoportugal/wagtail-modeltranslation#95). I couldn’t find the problem, so I thought it may be not related to that thirdy-app. I finally restarted from zero with the sample, but I see I get this traceback:
Traceback (most recent call last):
EventPage.objects.future()
File "C:\xxxxxxxxxxx\Lib\site-packages\django\db\models\manager.py", line 127, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
AttributeError: 'PageQuerySet' object has no attribute 'future'
- Python version: 2.7
- Django version: 1.8.x
- Wagtail version: 1.7
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Using custom Manager & QuerySet does not work with related ...
The problem is when we try to use both custom Manager and custom Queryset ( objects = AttendanceLogManager() ), such as:
Read more >Managers - Django documentation
The way Manager classes work is documented in Making queries; this document specifically touches on model options that customize Manager behavior.
Read more >Custom Model Manager & Model QuerySet in Django - YouTube
In this video, I'm gonna be discussing about custom model manager and custom model queryset in Django. Model manager and queryset are a ......
Read more >Working with QuerySets and managers | Django 3 By Example
QuerySets usually return another unevaluated QuerySet. You can concatenate as many filters as you like to a QuerySet, and you will not hit...
Read more >Managers — Django v1.3.1 documentation
A Manager is the interface through which database query operations are provided to ... of a model object -- use Model methods, not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can confirm that the EventPageQuerySet example doesn’t currently work as written, because
BasePageManager
inwagtailcore.models
has a hard-coded reference to PageQuerySet - I’ve now opened #3557 to fix this.I also ran into this problem and solved it by overriding the get_queryset function on a custom Manager.
Edit: Python3 Django 1.10 Wagtail 1.9