Abstract base user

27 views
Skip to first unread message

afsana shamsudheen

unread,
Sep 10, 2021, 1:50:28 PMSep 10
to Django users
how can i add two different users in django?
and make registration and loginform 

Kasper Laudrup

unread,
Sep 10, 2021, 2:38:36 PMSep 10
to django...@googlegroups.com
OpenPGP_0xE5D9CAC64AAA55EB.asc
OpenPGP_signature

Muhammad Shehzad

unread,
Sep 15, 2021, 3:37:52 AMSep 15
to django...@googlegroups.com
class UserManager(DjangoUserManager):
def create_one_user(self, username, email, password, **extra_fields):
return self._create_user(
username, email, password, type="one", **extra_fields
)

def create_two_user(self, username, email, password, **extra_fields):
return self._create_user(
username, email, password, type="two", **extra_fields
)

class User(AbstractUser):
class Type(models.TextChoices):
ORGANIZATION = "one"
CANDIDATE = "two"

objects = UserManager()

On Fri, Sep 10, 2021 at 10:49 PM afsana shamsudheen <afsanash...@gmail.com> wrote:
how can i add two different users in django?
and make registration and loginform 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1dc8141c-53b7-4f7e-bee4-991160749ba0n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages