testing / auth_api /models.py
Danielsz's picture
deploy
16e8be2
Raw
History Blame Contribute Delete
371 Bytes
from django.contrib.auth.models import AbstractUser
from django.db import models
class User(AbstractUser):
ROLE_CHOICES = (
('admin', 'Administrador'),
('user', 'Usuario'),
)
role = models.CharField(max_length=10, choices=ROLE_CHOICES, default='user')
def __str__(self):
return f"{self.username} ({self.get_role_display()})"