[Python-modules-commits] [python-social-auth] 28/61: Adding a model manager for the django app.
Wolfgang Borgert
debacle at moszumanska.debian.org
Sat Dec 24 15:14:04 UTC 2016
This is an automated email from the git hooks/post-receive script.
debacle pushed a commit to tag v0.2.13
in repository python-social-auth.
commit 5df5ea02f1710b2f3b1c4cee22646b7f8d33d8a7
Author: Troy Grosfield <troy.grosfield at gmail.com>
Date: Wed Jul 29 10:42:03 2015 -0600
Adding a model manager for the django app.
---
social/apps/django_app/default/managers.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/social/apps/django_app/default/managers.py b/social/apps/django_app/default/managers.py
new file mode 100644
index 0000000..5e8769d
--- /dev/null
+++ b/social/apps/django_app/default/managers.py
@@ -0,0 +1,12 @@
+from django.db import models
+
+
+class UserSocialAuthManager(models.Manager):
+ """Manager for the UserSocialAuth django model."""
+
+ def get_social_auth(self, provider, uid):
+ try:
+ return self.select_related('user').get(provider=provider,
+ uid=uid)
+ except self.model.DoesNotExist:
+ return None
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-social-auth.git
More information about the Python-modules-commits
mailing list