Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/events/api/views.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test cases?

Copy link
Collaborator

@Ritabear Ritabear Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這東西當初沒有溝通好,所以又是一張這兩天必須完成的票
議程組還要上去打議程資訊
所以測試我請他之後補

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,20 @@
else:
return ''

@property
def custom_event(self) -> bool:
if isinstance(self.obj, CustomEvent):
return not self.obj.break_event

Check warning on line 256 in src/events/api/views.py

View check run for this annotation

Codecov / codecov/patch

src/events/api/views.py#L255-L256

Added lines #L255 - L256 were not covered by tests
else:
return False

Check warning on line 258 in src/events/api/views.py

View check run for this annotation

Codecov / codecov/patch

src/events/api/views.py#L258

Added line #L258 was not covered by tests

@property
def custom_event_path(self) -> str:
if self.custom_event:
return self.obj.link_path

Check warning on line 263 in src/events/api/views.py

View check run for this annotation

Codecov / codecov/patch

src/events/api/views.py#L262-L263

Added lines #L262 - L263 were not covered by tests
else:
return ''

Check warning on line 265 in src/events/api/views.py

View check run for this annotation

Codecov / codecov/patch

src/events/api/views.py#L265

Added line #L265 was not covered by tests

def display(self):
return {
'event_id': self.event_id,
Expand All @@ -263,6 +277,8 @@
'language': self.language,
'python_level': self.python_level,
'break_event': self.break_event,
'custom_event': self.custom_event,
'custom_event_path': self.custom_event_path,
}


Expand Down
43 changes: 43 additions & 0 deletions src/events/migrations/0055_auto_20250707_2327.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Generated by Django 3.2.25 on 2025-07-07 15:27

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('events', '0054_auto_20250517_1525'),
]

operations = [
migrations.AlterField(
model_name='customevent',
name='location',
field=models.CharField(blank=True, choices=[('4-r0', 'R0'), ('5-r1', 'R1'), ('6-r2', 'R2'), ('1-r3', 'R3'), ('7-r4', 'R4'), ('81-spt-os', 'Sprint / Open Space'), ('82-tutorial', 'Tutorial'), ('83-yi-ps', 'Young Inspire / Poster Session')], db_index=True, max_length=12, null=True, verbose_name='location'),
),
migrations.AlterField(
model_name='joblistingsevent',
name='location',
field=models.CharField(blank=True, choices=[('4-r0', 'R0'), ('5-r1', 'R1'), ('6-r2', 'R2'), ('1-r3', 'R3'), ('7-r4', 'R4'), ('81-spt-os', 'Sprint / Open Space'), ('82-tutorial', 'Tutorial'), ('83-yi-ps', 'Young Inspire / Poster Session')], db_index=True, max_length=12, null=True, verbose_name='location'),
),
migrations.AlterField(
model_name='keynoteevent',
name='location',
field=models.CharField(blank=True, choices=[('4-r0', 'R0'), ('5-r1', 'R1'), ('6-r2', 'R2'), ('1-r3', 'R3'), ('7-r4', 'R4'), ('81-spt-os', 'Sprint / Open Space'), ('82-tutorial', 'Tutorial'), ('83-yi-ps', 'Young Inspire / Poster Session')], db_index=True, max_length=12, null=True, verbose_name='location'),
),
migrations.AlterField(
model_name='proposedtalkevent',
name='location',
field=models.CharField(blank=True, choices=[('4-r0', 'R0'), ('5-r1', 'R1'), ('6-r2', 'R2'), ('1-r3', 'R3'), ('7-r4', 'R4'), ('81-spt-os', 'Sprint / Open Space'), ('82-tutorial', 'Tutorial'), ('83-yi-ps', 'Young Inspire / Poster Session')], db_index=True, max_length=12, null=True, verbose_name='location'),
),
migrations.AlterField(
model_name='proposedtutorialevent',
name='location',
field=models.CharField(blank=True, choices=[('4-r0', 'R0'), ('5-r1', 'R1'), ('6-r2', 'R2'), ('1-r3', 'R3'), ('7-r4', 'R4'), ('81-spt-os', 'Sprint / Open Space'), ('82-tutorial', 'Tutorial'), ('83-yi-ps', 'Young Inspire / Poster Session')], db_index=True, max_length=12, null=True, verbose_name='location'),
),
migrations.AlterField(
model_name='sponsoredevent',
name='location',
field=models.CharField(blank=True, choices=[('4-r0', 'R0'), ('5-r1', 'R1'), ('6-r2', 'R2'), ('1-r3', 'R3'), ('7-r4', 'R4'), ('81-spt-os', 'Sprint / Open Space'), ('82-tutorial', 'Tutorial'), ('83-yi-ps', 'Young Inspire / Poster Session')], db_index=True, max_length=12, null=True, verbose_name='location'),
),
]
27 changes: 16 additions & 11 deletions src/events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,29 +116,34 @@ class Location:
R2_2 = '6-r2-2'
R4 = '7-r4'
OTHER = '8-oth'
SPT_OS = '81-spt-os' # sprint / open space
TUTORIAL = '82-tutorial' # tutorial
YI_PS = '83-yi-ps' # young inspire / poster session
Comment on lines +119 to +121
Copy link
Member

@mattwang44 mattwang44 Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

過去都是用 location 名稱 (會議室編號) 來作為選項,為何這裡會用活動名稱作為選項?
(送到前端傳達的意思變成「tutorial(活動)在 tutorial(地點)舉辦」,這樣是預期的嗎?)

Copy link
Collaborator

@Ritabear Ritabear Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是 今天的scedule變動比較大,然後這些都要單獨一個一軌,名稱就是location,然後給議程組設定活動
前端部分會像coscup

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

前端對於活動地點的資訊會如何呈現呢?有設計稿或者任何文字說明嗎?
我現在比較難想像後端這樣修改之後前端要怎麼使用這些資訊

Copy link
Collaborator

@Ritabear Ritabear Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image 類似這種感覺吧 對方當初給我說明是線上口頭跟我們說明 時間也是不是pycon 以往切死的時間段

Copy link
Member

@mattwang44 mattwang44 Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

送到前端傳達的意思變成「tutorial(活動)在 tutorial(地點)舉辦」,這樣是預期的嗎?

我覺得這樣就是會產生這個問題XD
不過這不是程式問題, not a PR blocker,要跟 stakeholder 確認這是預期行為及可能發生的問題

時間也是不是pycon 以往切死的時間段

有更多說明嗎(什麼意思、預期怎麼實作)?
「切死的時間段」指的是「 schedule 頁面上 slot 長度大致與活動時長成正比」還是「schedule 頁面上橫軸位置大致代表時間點」?我覺得這兩件事任一被改掉都只會對 UX 有負面影響

Copy link
Collaborator

@Ritabear Ritabear Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

會把一個活動 EX: tutorial 標記為是在「tutorial」這個地點舉辦。是當初PM跟我們說的
他們到時候會在教室外面貼這是tutorial地點

目前每個活動時長不一、可以有彈性,slot 不再強制對齊 (schedule 頁面上 slot 長度大致與活動時長成正比) 會像是google calender 一樣,時間多長就佔多長的bolck 跟位置

這兩個都是今年新需求
不知道有沒有回答到><

Copy link
Member

@mattwang44 mattwang44 Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

但是 google calendar 是完全的 slot 長度與活動時長成正比,過去的 schedule 頁面也是時間比較長就會有顯示比較長的 slot (只是 DB 的 "Time" table 就要塞好每個時間點),所以我看不出你描述的差異是什麼?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我們有discord 回覆><



class BaseEvent(ConferenceRelated):
"""Base interface for all events in the schedule.
"""
LOCATION_CHOICES = [
(Location.ALL, _('All rooms')),
(Location.R012, _('R0, R1, R2')),
# (Location.ALL, _('All rooms')),
# (Location.R012, _('R0, R1, R2')),
(Location.R0, _('R0')),
(Location.R0_1, _('R0_1')),
(Location.R0_2, _('R0_2')),
# (Location.R0_1, _('R0_1')),
# (Location.R0_2, _('R0_2')),
(Location.R1, _('R1')),
(Location.R1_1, _('R1_1')),
(Location.R1_2, _('R1_2')),
# (Location.R1_1, _('R1_1')),
# (Location.R1_2, _('R1_2')),
(Location.R2, _('R2')),
(Location.R2_1, _('R2_1')),
(Location.R2_2, _('R2_2')),
# (Location.R2_1, _('R2_1')),
# (Location.R2_2, _('R2_2')),
(Location.R3, _('R3')),
(Location.R4, _('Open Space')),
(Location.OTHER, _('Other')),
(Location.R4, _('R4')),
(Location.SPT_OS , _('Sprint / Open Space')),
(Location.TUTORIAL, _('Tutorial')),
(Location.YI_PS, _('Young Inspire / Poster Session')),
]
location = models.CharField(
max_length=6,
max_length=12,
choices=LOCATION_CHOICES,
blank=True,
null=True,
Expand Down
Loading