Giter VIP home page Giter VIP logo

Comments (7)

clokep avatar clokep commented on July 17, 2024

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.

ba1dr avatar ba1dr commented on July 17, 2024

Yes, I use router

from django-querysetsequence.

clokep avatar clokep commented on July 17, 2024

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.

ba1dr avatar ba1dr commented on July 17, 2024

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.

clokep avatar clokep commented on July 17, 2024

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:

https://github.com/percipient/django-querysetsequence/blob/cee97082a13e243a5225e5c4eb3cecd7b2fd3f7d/queryset_sequence/__init__.py#L332-L337

from django-querysetsequence.

ba1dr avatar ba1dr commented on July 17, 2024

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.

clokep avatar clokep commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.