diff --git a/apps/user/forms.py b/apps/user/forms.py index 6066c132..b56bf133 100644 --- a/apps/user/forms.py +++ b/apps/user/forms.py @@ -31,6 +31,11 @@ class UserEditForm(forms.ModelForm): site = forms.URLField(required=False) photo = forms.ImageField(required=False) + child_gender = forms.CharField(required=False) + child_birthday = forms.DateField(input_formats=['%d.%m.%Y'], required=False) + child_first_name = forms.CharField(required=False) + child_last_name = forms.CharField(required=False) + class Meta: model = User fields = ( @@ -56,6 +61,10 @@ class UserEditForm(forms.ModelForm): 'vkontakte', 'site', 'photo', + 'child_gender', + 'child_birthday', + 'child_first_name', + 'child_last_name', ) diff --git a/apps/user/migrations/0030_auto_20190318_1320.py b/apps/user/migrations/0030_auto_20190318_1320.py new file mode 100644 index 00000000..7f926b45 --- /dev/null +++ b/apps/user/migrations/0030_auto_20190318_1320.py @@ -0,0 +1,33 @@ +# Generated by Django 2.0.7 on 2019-03-18 13:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('user', '0029_emaillog'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='child_birthday', + field=models.DateField(blank=True, null=True, verbose_name='День рождения ребенка'), + ), + migrations.AddField( + model_name='user', + name='child_first_name', + field=models.CharField(blank=True, max_length=30, verbose_name='Имя ребенка'), + ), + migrations.AddField( + model_name='user', + name='child_gender', + field=models.CharField(choices=[('n', 'не указан'), ('m', 'Мужчина'), ('f', 'Женщина')], default='n', max_length=1, verbose_name='Пол ребенка'), + ), + migrations.AddField( + model_name='user', + name='child_last_name', + field=models.CharField(blank=True, max_length=150, verbose_name='Фамилия ребенка'), + ), + ] diff --git a/apps/user/models.py b/apps/user/models.py index 37da804e..2f4bb9fb 100644 --- a/apps/user/models.py +++ b/apps/user/models.py @@ -89,6 +89,12 @@ class User(AbstractUser): verbose_name='Галерея', null=True, blank=True, ) + child_first_name = models.CharField('Имя ребенка', max_length=30, blank=True) + child_last_name = models.CharField('Фамилия ребенка', max_length=150, blank=True) + child_gender = models.CharField( + 'Пол ребенка', max_length=1, default='n', choices=GENDER_CHOICES) + child_birthday = models.DateField('День рождения ребенка', null=True, blank=True) + objects = UserManager() USERNAME_FIELD = 'email' diff --git a/apps/user/templates/user/profile-settings.html b/apps/user/templates/user/profile-settings.html index 7de0e74c..2f3a4b66 100644 --- a/apps/user/templates/user/profile-settings.html +++ b/apps/user/templates/user/profile-settings.html @@ -76,15 +76,6 @@