Comments (7)
I don't think this has been tested before, although I'm a little bit surprised that it doesn't work. It should make copies of each QuerySet
. How do you have it set-up to use different databases? Are you using a database router or some other technique?
from django-querysetsequence.
Yes, I use router
from django-querysetsequence.
I can reproduce this using our internal code-base, it'd be helpful to have a reduce test-case for this in our test suite to actually debug it further! I probably won't have time to look into that too soon though.
from django-querysetsequence.
I think the issue is caused by router's processing of the cloned querysets.
The logic inside the router might be different depending of the project. In my case it looks inside Meta
and looks for the custom database='dbname'
attribute. Another router (as per django docs) may rely on app name of the model.
If you replace the model with Proxy class this might cause the issue.
No proofs yet, just guessing.
from django-querysetsequence.
Our router is configure similar to https://strongarm.io/blog/multiple-databases-in-django/ (so it uses the _meta.app_label
), but yeah that could be it. The QuerySetSequence
replaces the model with a "fake" model, so that's probably what is causing the problem. You can see the code here:
from django-querysetsequence.
I think you can insert the original app_label
to the fake model. And if you could inherit all Meta
attributes - this would be very useful too.
from django-querysetsequence.
It should inherit the other Meta
attributes (see https://github.com/percipient/django-querysetsequence/blob/cee97082a13e243a5225e5c4eb3cecd7b2fd3f7d/queryset_sequence/__init__.py#L330-L333). I think there was an issue if you use an app_label
that matches a real installed app.
from django-querysetsequence.
Related Issues (20)
- Retrieving related values doen't work after order_by() HOT 3
- Need help! How to pass the serializers with the QuerySetSequence? HOT 2
- Slicing issue HOT 6
- DJ1.10: TypeError: not_impl() got an unexpected keyword argument 'using' HOT 4
- NotImplementedError: QuerySequence does not implement get_compiler() HOT 8
- Implement distinct() HOT 8
- 'QuerySetSequence' object has no attribute '_cloning' HOT 3
- Broken support for DjangoFilterBackend?
- New Version HOT 3
- Support Django 3.0 ( / drop support for Django 1.11 / Python 2.7) HOT 5
- SyntaxWarning: "is not" with a literal. Did you mean "!="? HOT 6
- pip installing this package is still using django.utils import six HOT 1
- 'QuerySetSequence' object has no attribute 'query' HOT 1
- AttributeError: 'QuerySetSequence' object has no attribute '_prefetch_related_lookups' HOT 10
- Support using `models.F` in `QuerySetSequence.order_by()` HOT 1
- Support asynchronous ORM methods
- Support Django 4.1 fields for `bulk_create()`
- Support prefetching in `iterator()`
- Support order_by with None value HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-querysetsequence.