from django.db import models

# Create your models here.
class Partner(models.Model):
    title = models.CharField(max_length=200, blank=True, null=True, help_text="Image title (optional)")
    image = models.ImageField(upload_to = ('partner/'), help_text="Upload image")
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

    class Meta:
        verbose_name= "Partner"
        verbose_name_plural = "Partner Image"
        ordering = ['-created_at']

    def __str__(self):
        return self.title if self.title else f"Partner image {self.id}"