diff --git a/codechallenges/admin.py b/codechallenges/admin.py index 1821a8d..39152bf 100644 --- a/codechallenges/admin.py +++ b/codechallenges/admin.py @@ -1,7 +1,7 @@ from django.contrib import admin # Register your models here. -from .models import Question, Submission, CodeChallengeEvent +from .models import Question, Submission, Event @admin.register(Question) @@ -14,6 +14,6 @@ class CustomerSubmission(admin.ModelAdmin): list_display = ("email", "correct") -@admin.register(CodeChallengeEvent) -class CustomerCodeChallengeEvent(admin.ModelAdmin): +@admin.register(Event) +class CustomerEvent(admin.ModelAdmin): list_display = ("title", "description") diff --git a/codechallenges/migrations/0001_initial.py b/codechallenges/migrations/0001_initial.py index 5adec55..4f47a02 100644 --- a/codechallenges/migrations/0001_initial.py +++ b/codechallenges/migrations/0001_initial.py @@ -11,7 +11,7 @@ class Migration(migrations.Migration): operations = [ migrations.CreateModel( - name="CodeChallengeEvent", + name="Event", fields=[ ( "id", diff --git a/codechallenges/migrations/0002_auto_20210103_1132.py b/codechallenges/migrations/0002_auto_20210103_1132.py index e145676..9652aa8 100644 --- a/codechallenges/migrations/0002_auto_20210103_1132.py +++ b/codechallenges/migrations/0002_auto_20210103_1132.py @@ -18,7 +18,7 @@ class Migration(migrations.Migration): blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, - to="codechallenges.codechallengeevent", + to="codechallenges.event", ), ), migrations.AddField( diff --git a/codechallenges/models.py b/codechallenges/models.py index ec2c88c..1249a97 100644 --- a/codechallenges/models.py +++ b/codechallenges/models.py @@ -1,7 +1,7 @@ from django.db import models -class CodeChallengeEvent(models.Model): +class Event(models.Model): title = models.CharField(max_length=150) description = models.TextField() @@ -24,7 +24,7 @@ class Question(models.Model): release_date = models.DateField() expiration_date = models.DateField() event = models.ForeignKey( - CodeChallengeEvent, on_delete=models.CASCADE, blank=True, null=True + Event, on_delete=models.CASCADE, blank=True, null=True ) def __str__(self):