Project-Stage-Academy / UA1244_beta

1 stars 0 forks source link

Define Django Models for Users #26

Closed mehalyna closed 2 weeks ago

mehalyna commented 3 weeks ago

Define Django Models for Users

Create Django models for the User entities that reflect the provided database schema. Ensure all fields and relationships are accurately represented within the Django ORM.

Task Description:

  1. Define the User Model
    • Action: In your users app (create one if it doesn't exist), define a User model in models.py with all the fields as specified in the schema: user_id, first_name, last_name, email, password, user_phone, title, and role.
    • Fields:
      • Use models.AutoField for user_id with primary_key=True.
      • Use models.CharField for string-based fields.
      • Add email uniqueness constraint using unique=True.
      • Consider using models.IntegerField or models.PositiveSmallIntegerField for the role field.

Considerations:

Deliverables: