Merged
Conversation
Signed-off-by: SaJH <wogur981208@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR implements sponsor-related API functionality, including endpoints, models, serializers, migrations, translations, and configuration updates to support sponsor and sponsor tier management.
- Introduces the Sponsor API endpoints with associated views, serializers, and URL routes.
- Adds new models and migrations to define sponsor, sponsor tier, and their relationships.
- Implements translations and registers models in the app configuration, along with updating project settings.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| app/user/migrations/0003_alter_historicaluserext_is_active.py | Updates the 'is_active' field for historical user extension. |
| app/event/views.py | Removes the placeholder comment. |
| app/event/tests.py | Removes the placeholder comment. |
| app/event/sponsor/views.py | Implements the SponsorViewSet using DRF mixins. |
| app/event/sponsor/urls.py | Adds URL routes for the Sponsor API endpoints. |
| app/event/sponsor/translation.py | Registers translation options for sponsor models. |
| app/event/sponsor/serializers.py | Adds serializers for Sponsor and SponsorTier models. |
| app/event/sponsor/models.py | Defines new Sponsor models and the relationship through a join table. |
| app/event/sponsor/migrations/0001_initial.py | Creates initial migration for sponsor-related models. |
| app/event/sponsor/apps.py | Configures the sponsor app and registers models for history tracking and translation. |
| app/event/admin.py | Removes the placeholder comment. |
| app/core/settings.py | Adds the sponsor app to the project settings. |
Comments suppressed due to low confidence (1)
app/event/sponsor/models.py:11
- [nitpick] Consider renaming the 'sponsor_tier' field to 'sponsor_tiers' to more clearly indicate that it represents a collection of tiers.
sponsor_tier = models.ManyToManyField(to="SponsorTier", through="SponsorTierSponsorRelation")
Signed-off-by: SaJH <wogur981208@gmail.com>
Signed-off-by: SaJH <wogur981208@gmail.com>
MU-Software
reviewed
Jun 7, 2025
app/event/sponsor/models.py
Outdated
| event = models.ForeignKey(Event, on_delete=models.PROTECT, related_name="sponsors") | ||
| name = models.CharField(max_length=256, null=True, blank=True) | ||
| logo = models.URLField(null=True, blank=True) | ||
| description = models.CharField(max_length=1000, null=True, blank=True) |
Member
There was a problem hiding this comment.
Suggested change
| description = models.CharField(max_length=1000, null=True, blank=True) | |
| description = models.TextField(null=True, blank=True) |
요건 어떨까요?
- 저희 PSQL이라 varchar 타입이나 text 타입이나 둘 다 성능 차이가 없고
description으로 쿼리할 일이 없는지라, index 생성으로 인한 길이 제한 이슈가 없거든요!
Member
Author
There was a problem hiding this comment.
어엇 이거 text field로 했었는데 왜 charfield로 되어있죠...ㅋㅋㅋㅋ 수정하겠습니다.
MU-Software
reviewed
Jun 7, 2025
app/event/sponsor/views.py
Outdated
|
|
||
|
|
||
| class SponsorViewSet(mixins.ListModelMixin, viewsets.GenericViewSet): | ||
| queryset = Sponsor.objects.prefetch_related("sponsor_tier").all() |
Member
There was a problem hiding this comment.
Suggested change
| queryset = Sponsor.objects.prefetch_related("sponsor_tier").all() | |
| queryset = Sponsor.objects.prefetch_related("sponsor_tier").filter_active() |
활성화된 것만 쿼리하도록 부탁드립니다 🙇♂️
Signed-off-by: SaJH <wogur981208@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.