Skip to content

How to serialize an extended user? #9431

@AhmadM-DL

Description

@AhmadM-DL

I am building an API based application.
Users register through an API.
For registration an extended user model has been written as proposed by Django documentation:

class UserProfile(models.Model):
    user = models.OneToOneField(User, on_delete= models.CASCADE)
    phone_number = models.CharField(max_length=25, unique=True, validators=[RegexValidator(r"^\+(?:[0-9] ?){6,14}[0-9]$")])
    language_preferences = models.CharField(max_length= 35)

How to write the signup view and serializer for this model?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions