-
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 branch 'main' of https://github.com/chaeunho1227/2024_spring_fe…
…stival_back into ceh-booth
- Loading branch information
Showing
16 changed files
with
419 additions
and
16 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 5.0.4 on 2024-05-22 21:57 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('booth', '0002_rename_longtude_booth_longitude_remove_booth_end_at_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Comment', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('writer', models.CharField(max_length=20)), | ||
('content', models.TextField()), | ||
('password', models.CharField(max_length=10)), | ||
('created_at', models.DateTimeField(auto_now_add=True)), | ||
('booth', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='booth.booth')), | ||
], | ||
), | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
from django.urls import path, include | ||
from rest_framework import routers | ||
|
||
from .views import BoothViewSet | ||
from .views import BoothViewSet, CommentViewSet | ||
|
||
app_name = 'booth' | ||
|
||
booth_router = routers.SimpleRouter(trailing_slash=False) | ||
booth_router.register('booth', BoothViewSet, basename='booth') | ||
|
||
comment_router = routers.SimpleRouter(trailing_slash=False) | ||
comment_router.register('comment', CommentViewSet, basename='comment') | ||
|
||
urlpatterns = [ | ||
path('', include(booth_router.urls)), | ||
path('booth/<int:id>/', include(comment_router.urls)), | ||
path('', include(comment_router.urls)), | ||
] |
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
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
from django.contrib import admin | ||
|
||
from .models import * | ||
# Register your models here. | ||
|
||
admin.site.register(Performance) | ||
admin.site.register(Artist) | ||
admin.site.register(Music) | ||
admin.site.register(ArtistImage) | ||
admin.site.register(MusicImage) |
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,66 @@ | ||
# Generated by Django 5.0.4 on 2024-05-22 03:14 | ||
|
||
import core.models | ||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Artist', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=100)), | ||
('date', models.DateField()), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Performance', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('operator', models.CharField(max_length=100)), | ||
('location', models.CharField(max_length=100)), | ||
('start_at', models.DateTimeField()), | ||
('end_at', models.DateTimeField()), | ||
('date', models.DateField()), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='ArtistImage', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('image', models.ImageField(blank=True, null=True, upload_to=core.models.image_upload_path)), | ||
('artist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='timetable.artist')), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='Music', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('title', models.CharField(max_length=100)), | ||
('ytb_url', models.URLField(blank=True)), | ||
('artist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='timetable.artist')), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='MusicImage', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('image', models.ImageField(blank=True, null=True, upload_to=core.models.image_upload_path)), | ||
('music', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='timetable.music')), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
] |
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 |
---|---|---|
@@ -1,3 +1,34 @@ | ||
from django.db import models | ||
from core.models import BaseImage | ||
|
||
# Create your models here. | ||
class Performance(models.Model): | ||
operator = models.CharField(max_length=100) | ||
location = models.CharField(max_length=100) | ||
start_at = models.DateTimeField() | ||
end_at = models.DateTimeField() | ||
date = models.DateField() | ||
|
||
def __str__(self): | ||
return self.operator | ||
|
||
class Artist(models.Model): | ||
name = models.CharField(max_length=100) | ||
date = models.DateField() | ||
|
||
def __str__(self): | ||
return self.name | ||
|
||
class Music(models.Model): | ||
title = models.CharField(max_length=100) | ||
artist = models.ForeignKey(Artist, on_delete=models.CASCADE) | ||
ytb_url = models.URLField(max_length=200, blank=True) | ||
|
||
def __str__(self): | ||
return self.title | ||
|
||
class ArtistImage(BaseImage): | ||
artist = models.ForeignKey(Artist, on_delete=models.CASCADE) | ||
|
||
class MusicImage(BaseImage): | ||
music = models.OneToOneField(Music, on_delete=models.CASCADE) |
Oops, something went wrong.