Skip to content

Conversation

@benjaoming
Copy link

You need this to have your querysets fully identical to standard queryset behavior :) Notice there's some change in Django 1.6 that I didn't fully catch up on.

You need this to have your querysets fully identical to standard queryset behavior :) Notice there's some change in Django 1.6 that I didn't fully catch up on.
@benjaoming
Copy link
Author

Admittedly I didn't see you were using pass_through_manager -- can you tell me if for instance objects.none().published() already works?

@benjaoming
Copy link
Author

Btw great job, very inspirational

@kevinastone
Copy link
Owner

chaining after a call to none() doesn't work with PassthroughManager because it changes to an EmptyQuerySet so it no longer returns our custom QuerySet sub-class. Your commit doesn't necessarily resolve this since you need to wire PassthroughManager.

I think this is better solved by PassthroughManager directly. Without that, I'd focus on making a generic solution by sub-classing PassthroughManager or our base QuerySet, and return a sub-class of EmptyQuerySet that accepts arbitrary chained methods and just returns itself.

@benjaoming
Copy link
Author

PassthroughManager is a nice idea, but I rather don't like the dependency because it's such simple code that it's easy to deal with either by copy-pasting the PassthroughManager itself or just write the QuerySet and the manager explicitly. A rather small bargain to avoid dependencies :)

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

Successfully merging this pull request may close these issues.

2 participants