summaryrefslogtreecommitdiff
path: root/drupal_auth/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'drupal_auth/models.py')
-rw-r--r--drupal_auth/models.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/drupal_auth/models.py b/drupal_auth/models.py
new file mode 100644
index 0000000..e3fab6b
--- /dev/null
+++ b/drupal_auth/models.py
@@ -0,0 +1,28 @@
+from django.db import models
+from django.contrib.auth.models import User
+from django.contrib.auth.models import (
+ BaseUserManager, AbstractBaseUser
+)
+
+from drupal_auth.managers import DrupalUserManager
+
+class Users(models.Model):
+ name = models.CharField(max_length=60L, unique=True, primary_key=True)
+ pass_field = models.CharField(max_length=32L, db_column='pass') # Field renamed because it was a Python reserved word.
+ last_login = models.DateTimeField(auto_now_add=True)
+
+ USERNAME_FIELD = 'name'
+ REQUIRED_FIELDS = []
+ objects = DrupalUserManager()
+
+ class Meta:
+ db_table = 'users'
+
+ def is_authenticated(self):
+ return True
+#class Test(AbstractBaseUser):
+# username = models.CharField(max_length=40, unique=True, db_index=True)
+# USERNAME_FIELD = 'username'
+# REQUIRED_FIELDS = []
+#
+# objects = DrupalUserManager()