from django.db import models

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']