Created
January 22, 2014 15:28
-
-
Save loic/8560713 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/django/db/models/manager.py b/django/db/models/manager.py | |
index 4a080e9..24f9d95 100644 | |
--- a/django/db/models/manager.py | |
+++ b/django/db/models/manager.py | |
@@ -196,6 +196,14 @@ Manager = BaseManager.from_queryset(QuerySet, class_name='Manager') | |
Manager.__module__ = 'django.db.models.manager' | |
+class CustomQuerySet(QuerySet): | |
+ pass | |
+ | |
+CustomManager = Manager.from_queryset(CustomQuerySet, class_name='CustomManager') | |
+ | |
+print CustomManager.__module__ | |
+print CustomQuerySet.as_manager().__module__ | |
+ | |
class ManagerDescriptor(object): | |
# This class ensures managers aren't accessible via model instances. | |
# For example, Poll.objects works, but poll_obj.objects raises AttributeError. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment