Skip to content

Commit

Permalink
Merge pull request pycontw#1118 from pycontw/update/proposals
Browse files Browse the repository at this point in the history
feat(core/EventInfo): add willing_to_attend_in_person field
  • Loading branch information
josix committed Feb 17, 2023
2 parents 88cafab + be93d3e commit 2ee8f3b
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 20 deletions.
11 changes: 11 additions & 0 deletions src/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,17 @@ class EventInfo(models.Model):
choices=REFERRING_POLICY_CHOICES,
)

WILLING_TO_ATTEND_IN_PERSON = (
(True, _('Yes')),
(False, _('No')),
)

willing_to_attend_in_person = models.BooleanField(
verbose_name=_("attending PyCon TW in person"),
default=True,
choices=WILLING_TO_ATTEND_IN_PERSON,
)

class Meta:
abstract = True
ordering = ['-created_at']
Expand Down
18 changes: 18 additions & 0 deletions src/events/migrations/0048_add_willing_to_attend_in_person.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.1.7 on 2023-02-17 16:10

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('events', '0047_alter_language_choices_remove_talk_language'),
]

operations = [
migrations.AddField(
model_name='sponsoredevent',
name='willing_to_attend_in_person',
field=models.BooleanField(choices=[(True, 'Yes'), (False, 'No')], default=True, verbose_name='attending PyCon TW in person'),
),
]
24 changes: 15 additions & 9 deletions src/locale/en_US/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PyCon TW\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-02-13 22:44+0800\n"
"POT-Creation-Date: 2023-02-18 00:15+0800\n"
"PO-Revision-Date: 2022-07-11 02:23+0800\n"
"Last-Translator: Tom Chen <[email protected]>\n"
"Language-Team: English (United States) (http:https://www.transifex.com/pycon-"
Expand Down Expand Up @@ -246,12 +246,14 @@ msgid "detailed description"
msgstr "detailed description"

#: core/models.py:151 core/models.py:161 core/models.py:171 core/models.py:222
#: proposals/models.py:268 reviews/models.py:122 reviews/models.py:137
#: core/models.py:232 proposals/models.py:268 reviews/models.py:122
#: reviews/models.py:137
msgid "Yes"
msgstr "Yes"

#: core/models.py:152 core/models.py:162 core/models.py:172 core/models.py:223
#: proposals/models.py:269 reviews/models.py:123 reviews/models.py:138
#: core/models.py:233 proposals/models.py:269 reviews/models.py:123
#: reviews/models.py:138
msgid "No"
msgstr "No"

Expand Down Expand Up @@ -307,24 +309,28 @@ msgstr "prefer event time"
msgid "living in Taiwan"
msgstr "living in Taiwan"

#: core/models.py:258 reviews/admin.py:51
#: core/models.py:237
msgid "attending PyCon TW in person"
msgstr "attending PyCon TW in person"

#: core/models.py:269 reviews/admin.py:51
msgid "Key"
msgstr "Key"

#: core/models.py:262 proposals/models.py:62 users/models.py:198
#: core/models.py:273 proposals/models.py:62 users/models.py:198
#: users/models.py:313
msgid "user"
msgstr "user"

#: core/models.py:265
#: core/models.py:276
msgid "Created"
msgstr "created at"

#: core/models.py:268
#: core/models.py:279
msgid "Token"
msgstr ""

#: core/models.py:269
#: core/models.py:280
msgid "Tokens"
msgstr ""

Expand Down Expand Up @@ -846,7 +852,7 @@ msgstr ""
"<a href='http:https://daringfireball.net/projects/markdown/basics' target='_blank' "
"rel='noopener'>Markdown</a>. This is NOT made public and for REVIEW ONLY."

#: proposals/forms/proposals.py:35 proposals/forms/proposals.py:98
#: proposals/forms/proposals.py:35 proposals/forms/proposals.py:100
msgid "duration"
msgstr "Duration"

Expand Down
24 changes: 15 additions & 9 deletions src/locale/zh_Hant/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PyCon TW\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-02-13 22:44+0800\n"
"POT-Creation-Date: 2023-02-18 00:15+0800\n"
"PO-Revision-Date: 2022-07-11 02:25+0800\n"
"Last-Translator: Tom Chen <[email protected]>\n"
"Language-Team: Chinese Traditional (http:https://www.transifex.com/pycon-taiwan/"
Expand Down Expand Up @@ -253,12 +253,14 @@ msgid "detailed description"
msgstr "詳細說明"

#: core/models.py:151 core/models.py:161 core/models.py:171 core/models.py:222
#: proposals/models.py:268 reviews/models.py:122 reviews/models.py:137
#: core/models.py:232 proposals/models.py:268 reviews/models.py:122
#: reviews/models.py:137
msgid "Yes"
msgstr "是"

#: core/models.py:152 core/models.py:162 core/models.py:172 core/models.py:223
#: proposals/models.py:269 reviews/models.py:123 reviews/models.py:138
#: core/models.py:233 proposals/models.py:269 reviews/models.py:123
#: reviews/models.py:138
msgid "No"
msgstr "否"

Expand Down Expand Up @@ -314,24 +316,28 @@ msgstr "偏好議程時間"
msgid "living in Taiwan"
msgstr "是否住在台灣"

#: core/models.py:258 reviews/admin.py:51
#: core/models.py:237
msgid "attending PyCon TW in person"
msgstr "是否願意以實體方式與會"

#: core/models.py:269 reviews/admin.py:51
msgid "Key"
msgstr "鍵"

#: core/models.py:262 proposals/models.py:62 users/models.py:198
#: core/models.py:273 proposals/models.py:62 users/models.py:198
#: users/models.py:313
msgid "user"
msgstr "使用者"

#: core/models.py:265
#: core/models.py:276
msgid "Created"
msgstr "建立時間"

#: core/models.py:268
#: core/models.py:279
msgid "Token"
msgstr "驗證碼"

#: core/models.py:269
#: core/models.py:280
msgid "Tokens"
msgstr "驗證碼"

Expand Down Expand Up @@ -834,7 +840,7 @@ msgstr ""
"href='http:https://daringfireball.net/projects/markdown/basics' target='_blank' "
"rel='noopener'>Markdown</a> 格式編輯。本欄位不公開僅供審查使用。"

#: proposals/forms/proposals.py:35 proposals/forms/proposals.py:98
#: proposals/forms/proposals.py:35 proposals/forms/proposals.py:100
msgid "duration"
msgstr "時間長度"

Expand Down
2 changes: 2 additions & 0 deletions src/proposals/forms/proposals.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class Meta(TalkProposalMixin.Meta):
'referring_policy',
'prefer_time',
'living_in_taiwan',
'willing_to_attend_in_person',
]


Expand All @@ -75,6 +76,7 @@ class Meta(TutorialProposalMixin.Meta):
'live_stream_policy',
'prefer_time',
'living_in_taiwan',
'willing_to_attend_in_person',
]


Expand Down
23 changes: 23 additions & 0 deletions src/proposals/migrations/0059_add_willing_to_attend_in_person.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.1.7 on 2023-02-17 16:10

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('proposals', '0058_alter_language_choices_remove_talk_language'),
]

operations = [
migrations.AddField(
model_name='talkproposal',
name='willing_to_attend_in_person',
field=models.BooleanField(choices=[(True, 'Yes'), (False, 'No')], default=True, verbose_name='attending PyCon TW in person'),
),
migrations.AddField(
model_name='tutorialproposal',
name='willing_to_attend_in_person',
field=models.BooleanField(choices=[(True, 'Yes'), (False, 'No')], default=True, verbose_name='attending PyCon TW in person'),
),
]
6 changes: 4 additions & 2 deletions src/proposals/tests/forms/test_proposal.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def talk_proposal_data():
'referring_policy': True,
'first_time_speaker': True,
'living_in_taiwan': True,
'willing_to_attend_in_person': True,
'prefer_time': 'DAY_ONE_MORNING',
}

Expand All @@ -30,7 +31,7 @@ def test_talk_proposal_create_form():
assert list(form.fields) == [
'title', 'category', 'duration', 'language', 'python_level',
'recording_policy', 'live_stream_policy', 'first_time_speaker', 'referring_policy',
'prefer_time', 'living_in_taiwan',
'prefer_time', 'living_in_taiwan', 'willing_to_attend_in_person',
]


Expand Down Expand Up @@ -72,6 +73,7 @@ def tutorial_proposal_data():
'recording_policy': True,
'live_stream_policy': True,
'living_in_taiwan': True,
'willing_to_attend_in_person': True,
'prefer_time': 'DAY_ONE_MORNING',
}

Expand All @@ -81,7 +83,7 @@ def test_tutorial_proposal_create_form():
assert list(form.fields) == [
'title', 'category', 'duration', 'language',
'python_level', 'recording_policy', 'live_stream_policy',
'prefer_time', 'living_in_taiwan',
'prefer_time', 'living_in_taiwan', 'willing_to_attend_in_person',
]


Expand Down
2 changes: 2 additions & 0 deletions src/proposals/tests/views/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def test_talk_proposal_create_post(agreed_user, agreed_user_client):
'referring_policy': False,
'first_time_speaker': True,
'living_in_taiwan': True,
'willing_to_attend_in_person': True,
'prefer_time': 'DAY_ONE_MORNING',
}, follow=True)

Expand Down Expand Up @@ -127,6 +128,7 @@ def test_tutorial_proposal_create_post(agreed_user, agreed_user_client):
'recording_policy': True,
'live_stream_policy': True,
'living_in_taiwan': True,
'willing_to_attend_in_person': True,
'prefer_time': 'DAY_ONE_MORNING',
}, follow=True)

Expand Down

0 comments on commit 2ee8f3b

Please sign in to comment.