-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from soehlert/topic/soehlert/api
feat(api): Create scaffolding/first pass at an API
- Loading branch information
Showing
5 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from rest_framework import viewsets | ||
|
||
from ..models import Artist, Concert, Venue | ||
from .serializers import ArtistSerializer, ConcertSerializer, VenueSerializer | ||
|
||
|
||
class ArtistViewset(viewsets.ModelViewSet): | ||
queryset = Artist.objects.all() | ||
serializer_class = ArtistSerializer | ||
|
||
|
||
class VenueViewset(viewsets.ModelViewSet): | ||
queryset = Venue.objects.all() | ||
serializer_class = VenueSerializer | ||
|
||
|
||
class ConcertViewset(viewsets.ModelViewSet): | ||
queryset = Concert.objects.all() | ||
serializer_class = ConcertSerializer |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.2.4 on 2023-08-25 17:53 | ||
|
||
from django.db import migrations | ||
import django_countries.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("concerts", "0002_alter_concert_opener"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="venue", | ||
name="country", | ||
field=django_countries.fields.CountryField(default="US", max_length=2), | ||
), | ||
] |
This file contains 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
This file contains 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
This file contains 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