Skip to content

Commit

Permalink
Merge branch 'GDGVIT:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
rb-25 authored Apr 11, 2024
2 parents b485462 + 56f0be6 commit 7361d10
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ class Meta:


class EventListSerializer(serializers.ModelSerializer):
organization = OrganizationSerializer()
organizing_body = OrganizationSerializer()

class Meta:
model = Event
exclude = ["description", "event_coordinators"]


class EventDetailSerializer(serializers.ModelSerializer):
organization = OrganizationSerializer()
organizing_body = OrganizationSerializer()

class Meta:
model = Event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ class EventViewSet(ReadOnlyModelViewSet):
serializer_class = EventDetailSerializer
pagination_class = CustomPagination
filter_backends = [SearchFilter, OrderingFilter, DjangoFilterBackend]
filterset_fields = ["organization__name", "venue", "start_time", "end_time"]
search_fields = ["name", "organization__name", "venue", "start_time", "end_time"]
filterset_fields = ["organizing_body__name", "venue", "start_time", "end_time"]
search_fields = ["name", "organizing_body__name", "venue", "start_time", "end_time"]
ordering_fields = [
"name",
"organization__name",
"organizing_body__name",
"venue",
"start_time",
"end_time",
Expand Down Expand Up @@ -76,10 +76,10 @@ class EventAdminViewSet(ModelViewSet):
serializer_class = EventDetailSerializer
pagination_class = CustomPagination
filter_backends = [SearchFilter, OrderingFilter]
search_fields = ["name", "organization__name", "venue", "start_time", "end_time"]
search_fields = ["name", "organizing_body__name", "venue", "start_time", "end_time"]
ordering_fields = [
"name",
"organization__name",
"organizing_body__name",
"venue",
"start_time",
"end_time",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 4.0.10 on 2024-04-09 06:00

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('core', '0016_alter_organization_options_and_more'),
]

operations = [
migrations.RenameField(
model_name='event',
old_name='organization',
new_name='organizing_body',
),
migrations.AlterUniqueTogether(
name='event',
unique_together={('name', 'organizing_body')},
),
]

0 comments on commit 7361d10

Please sign in to comment.