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

Expose _filter_by_type as a method #36

Merged
merged 1 commit into from Apr 20, 2017

Conversation

sloria
Copy link
Contributor

@sloria sloria commented Apr 20, 2017

A small change to allow subclasses of TypedModelManager to more easily change their queryset type.

Example use case:

class PersonQuerySet(models.QuerySet):
    pass

class PersonManager(TypedModelManager):

    def get_queryset(self):
        qs = PersonQuerySet(self.model, using=self._db)
        return self._filter_by_type(qs)

This makes it easier to change the queryset class returned
by a TypedModelManager subclass's get_queryset() method
@coveralls
Copy link

coveralls commented Apr 20, 2017

Coverage Status

Coverage increased (+0.2%) to 79.771% when pulling 4cff144 on cos-forks:filter-by-type into 1a9d00d on craigds:master.

@craigds craigds merged commit bcd443b into craigds:master Apr 20, 2017
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.

None yet

3 participants