diff --git a/accounts/migrations/0019_user_gender.py b/accounts/migrations/0019_user_gender.py new file mode 100644 index 0000000..e29f8a2 --- /dev/null +++ b/accounts/migrations/0019_user_gender.py @@ -0,0 +1,18 @@ +# Generated by Django 4.0.8 on 2024-01-31 21:17 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounts', '0018_rename_department_student_program'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='gender', + field=models.CharField(blank=True, choices=[('M', 'Male'), ('F', 'Female')], max_length=1, null=True), + ), + ] diff --git a/accounts/models.py b/accounts/models.py index 2b92825..cfe9692 100644 --- a/accounts/models.py +++ b/accounts/models.py @@ -55,11 +55,17 @@ class CustomUserManager(UserManager): return queryset +GENDERS_CHOICES = (("M", "Male"), ("F", "Female")) + + class User(AbstractUser): is_student = models.BooleanField(default=False) is_lecturer = models.BooleanField(default=False) is_parent = models.BooleanField(default=False) is_dep_head = models.BooleanField(default=False) + gender = models.CharField( + max_length=1, choices=GENDERS_CHOICES, blank=True, null=True + ) phone = models.CharField(max_length=60, blank=True, null=True) address = models.CharField(max_length=60, blank=True, null=True) picture = models.ImageField(