diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index cd6f855..8718a8e 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index 9aa598b..24d6959 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 6867ddf..0729160 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/admin.py b/core/admin.py index 8c38f3f..debf9e2 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,8 @@ from django.contrib import admin +from .models import Event -# Register your models here. +@admin.register(Event) +class EventAdmin(admin.ModelAdmin): + list_display = ('artist_name', 'venue_name', 'date', 'city', 'status', 'age_restriction') + list_filter = ('status', 'city', 'date', 'age_restriction') + search_fields = ('artist_name', 'venue_name', 'city') \ No newline at end of file diff --git a/core/models.py b/core/models.py index 71a8362..0967bfb 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,29 @@ from django.db import models -# Create your models here. +class Event(models.Model): + AGE_CHOICES = [ + ('18+', '18+'), + ('21+', '21+'), + ('All Ages', 'All Ages'), + ] + STATUS_CHOICES = [ + ('Open', 'Open'), + ('Closed', 'Closed'), + ] + + artist_name = models.CharField(max_length=200) + date = models.DateField() + venue_name = models.CharField(max_length=200) + city = models.CharField(max_length=100) + state = models.CharField(max_length=100) + age_restriction = models.CharField(max_length=10, choices=AGE_CHOICES, default='21+') + status = models.CharField(max_length=10, choices=STATUS_CHOICES, default='Open') + description = models.TextField(blank=True) + featured_image = models.URLField(max_length=200, blank=True) + ticket_url = models.URLField(max_length=200, blank=True) + + def __str__(self): + return f"{self.artist_name} at {self.venue_name} on {self.date}" + + class Meta: + ordering = ['date'] \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 788576e..af6832d 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,11 +1,45 @@ -
+ -