From f022da61f40c259a64a77f7e10ddc28e83a1c83a Mon Sep 17 00:00:00 2001 From: polmf <99polmf@gmail.com> Date: Wed, 10 Dec 2025 23:19:31 -0500 Subject: [PATCH 1/2] nova pregunta --- applications/forms/hacker.py | 17 +++++++++++++++++ .../0060_hackerapplication_kind_studies.py | 18 ++++++++++++++++++ applications/models/constants.py | 11 +++++++++++ applications/models/hacker.py | 3 ++- 4 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 applications/migrations/0060_hackerapplication_kind_studies.py diff --git a/applications/forms/hacker.py b/applications/forms/hacker.py index 2fbbd9dda..29600733c 100644 --- a/applications/forms/hacker.py +++ b/applications/forms/hacker.py @@ -7,6 +7,7 @@ class HackerApplicationForm(_BaseApplicationForm): bootstrap_field_info = { "🎓 Education Info": { "fields": [ + {"name": "kind_studies", "space": 12}, {"name": "university", "space": 12}, {"name": "degree", "space": 12}, {"name": "graduation_year", "space": 12}, @@ -129,8 +130,24 @@ def clean_projects(self): ) return data + def clean_kind_studies(self): + data = self.cleaned_data["kind_studies"] + if not data or data == "": + raise forms.ValidationError("Please select your current studies.") + return data + first_timer = common_first_timer() + + kind_studies = forms.ChoiceField( + required=True, + label='What kind of studies are you currently pursuing?', + choices=([('', '- Select an option -')] + models.constants.KIND_STUDIES), + widget=forms.Select( + attrs={'class': 'form-control'} + ) + ) + university = common_university() diff --git a/applications/migrations/0060_hackerapplication_kind_studies.py b/applications/migrations/0060_hackerapplication_kind_studies.py new file mode 100644 index 000000000..c3bce53d3 --- /dev/null +++ b/applications/migrations/0060_hackerapplication_kind_studies.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.23 on 2025-12-11 03:00 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('applications', '0059_remove_volunteerapplication_pronouns'), + ] + + operations = [ + migrations.AddField( + model_name='hackerapplication', + name='kind_studies', + field=models.CharField(choices=[('SECONDARY', 'Secondary Education - Baccalaureate'), ('VOCATIONAL', 'Vocational Training (FP)'), ('BACHELOR', 'Bachelor’s Degree'), ('MASTER', 'Master’s Degree'), ('OTHER', 'Other')], default='NA', max_length=300), + ), + ] diff --git a/applications/models/constants.py b/applications/models/constants.py index dded778cb..dd79e66ae 100644 --- a/applications/models/constants.py +++ b/applications/models/constants.py @@ -91,6 +91,17 @@ (2, "Sunday") ] +ST_SECONDARY = 'SECONDARY' +ST_VOCATIONAL = 'VOCATIONAL' +ST_BACHELOR = 'BACHELOR' +ST_MASTER = 'MASTER' +ST_OTHER = 'OTHER' + +KIND_STUDIES = [ + (ST_SECONDARY, 'Secondary Education - Baccalaureate'), (ST_VOCATIONAL, 'Vocational Training (FP)'), + (ST_BACHELOR, 'Bachelor’s Degree'), (ST_MASTER, 'Master’s Degree'), (ST_OTHER, 'Other') +] + HACK_NAME = getattr(hackathon_variables, 'HACKATHON_NAME', "HackAssistant") EXTRA_NAME = [' 2016 Fall', ' 2016 Winter', ' 2017 Fall', ' 2017 Winter', ' 2018', ' 2019', ' 2021', ' 2022', ' 2023', ' 2024'] PREVIOUS_HACKS = [(i, HACK_NAME + EXTRA_NAME[i]) for i in range(0, len(EXTRA_NAME))] diff --git a/applications/models/hacker.py b/applications/models/hacker.py index 6e0a2dd99..facece336 100644 --- a/applications/models/hacker.py +++ b/applications/models/hacker.py @@ -13,7 +13,8 @@ class HackerApplication(BaseApplication): # Random lenny face lennyface = models.CharField(max_length=20, default="-.-") - # University + # Studies + kind_studies = models.CharField(max_length=300, choices=KIND_STUDIES, default=NO_ANSWER) graduation_year = models.IntegerField(choices=YEARS, default=DEFAULT_YEAR) university = models.CharField(max_length=300) degree = models.CharField(max_length=300) From 1dd430b117e5a2fe2049b51d813a271437b1e06d Mon Sep 17 00:00:00 2001 From: polmf <99polmf@gmail.com> Date: Sun, 28 Dec 2025 19:28:07 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Soluci=C3=B3=20migrations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../0060_hackerapplication_kind_studies.py | 18 ------ .../migrations/0062_auto_20251228_1817.py | 60 +++++++++++++++++++ 2 files changed, 60 insertions(+), 18 deletions(-) delete mode 100644 applications/migrations/0060_hackerapplication_kind_studies.py create mode 100644 applications/migrations/0062_auto_20251228_1817.py diff --git a/applications/migrations/0060_hackerapplication_kind_studies.py b/applications/migrations/0060_hackerapplication_kind_studies.py deleted file mode 100644 index c3bce53d3..000000000 --- a/applications/migrations/0060_hackerapplication_kind_studies.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.23 on 2025-12-11 03:00 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('applications', '0059_remove_volunteerapplication_pronouns'), - ] - - operations = [ - migrations.AddField( - model_name='hackerapplication', - name='kind_studies', - field=models.CharField(choices=[('SECONDARY', 'Secondary Education - Baccalaureate'), ('VOCATIONAL', 'Vocational Training (FP)'), ('BACHELOR', 'Bachelor’s Degree'), ('MASTER', 'Master’s Degree'), ('OTHER', 'Other')], default='NA', max_length=300), - ), - ] diff --git a/applications/migrations/0062_auto_20251228_1817.py b/applications/migrations/0062_auto_20251228_1817.py new file mode 100644 index 000000000..d9cae9d5a --- /dev/null +++ b/applications/migrations/0062_auto_20251228_1817.py @@ -0,0 +1,60 @@ +# Generated by Django 3.2.23 on 2025-12-28 18:17 + +import django.core.validators +from django.db import migrations, models +import multiselectfield.db.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('applications', '0061_volunteerapplication_other_hear_about_us'), + ] + + operations = [ + migrations.AddField( + model_name='hackerapplication', + name='kind_studies', + field=models.CharField(choices=[('SECONDARY', 'Secondary Education - Baccalaureate'), ('VOCATIONAL', 'Vocational Training (FP)'), ('BACHELOR', 'Bachelor’s Degree'), ('MASTER', 'Master’s Degree'), ('OTHER', 'Other')], default='NA', max_length=300), + ), + migrations.AlterField( + model_name='hackerapplication', + name='graduation_year', + field=models.IntegerField(choices=[(2025, '2025'), (2026, '2026'), (2027, '2027'), (2028, '2028'), (2029, '2029'), (2030, '2030'), (2031, '2031'), (2032, '2032')], default=2026), + ), + migrations.AlterField( + model_name='hackerapplication', + name='phone_number', + field=models.CharField(blank=True, max_length=16, null=True, validators=[django.core.validators.RegexValidator(message="Phone number must be entered in the format: '+#########'. Up to 16 digits allowed, with optional spaces.", regex='^\\+?1?\\d{1,4}(\\s?\\d{1,4}){2,8}$')]), + ), + migrations.AlterField( + model_name='mentorapplication', + name='graduation_year', + field=models.IntegerField(choices=[(2025, '2025'), (2026, '2026'), (2027, '2027'), (2028, '2028'), (2029, '2029'), (2030, '2030'), (2031, '2031'), (2032, '2032')], default=2026), + ), + migrations.AlterField( + model_name='mentorapplication', + name='phone_number', + field=models.CharField(blank=True, max_length=16, null=True, validators=[django.core.validators.RegexValidator(message="Phone number must be entered in the format: '+#########'. Up to 16 digits allowed, with optional spaces.", regex='^\\+?1?\\d{1,4}(\\s?\\d{1,4}){2,8}$')]), + ), + migrations.AlterField( + model_name='mentorapplication', + name='which_hack', + field=multiselectfield.db.fields.MultiSelectField(blank=True, choices=[(0, 'HackUPC2019 o anterior'), (1, 'HackUPC 2021'), (2, 'HackUPC 2022'), (3, 'HackUPC 2023'), (4, 'HackUPC 2024'), (5, 'HackUPC 2025')], max_length=11, null=True), + ), + migrations.AlterField( + model_name='volunteerapplication', + name='graduation_year', + field=models.IntegerField(choices=[(2025, '2025'), (2026, '2026'), (2027, '2027'), (2028, '2028'), (2029, '2029'), (2030, '2030'), (2031, '2031'), (2032, '2032')], default=2026), + ), + migrations.AlterField( + model_name='volunteerapplication', + name='phone_number', + field=models.CharField(blank=True, max_length=16, null=True, validators=[django.core.validators.RegexValidator(message="Phone number must be entered in the format: '+#########'. Up to 16 digits allowed, with optional spaces.", regex='^\\+?1?\\d{1,4}(\\s?\\d{1,4}){2,8}$')]), + ), + migrations.AlterField( + model_name='volunteerapplication', + name='which_hack', + field=multiselectfield.db.fields.MultiSelectField(choices=[(0, 'HackUPC2019 o anterior'), (1, 'HackUPC 2021'), (2, 'HackUPC 2022'), (3, 'HackUPC 2023'), (4, 'HackUPC 2024'), (5, 'HackUPC 2025')], max_length=11), + ), + ]