from django.db import models

# Create your models here.
class Realisation(models.Model):
    title = models.CharField("Titre", max_length=200)
    description = models.TextField("Description", blank=True)
    image1 = models.ImageField("Photo 1", upload_to='realisations/', null=True, blank=True)
    image2 = models.ImageField("Photo 2", upload_to='realisations/', null=True, blank=True)
    image3 = models.ImageField("Photo 3", upload_to='realisations/', null=True, blank=True)
    published = models.BooleanField("Publié", default=True)
    created_at = models.DateTimeField(auto_now_add=True)

    class Meta:
        verbose_name = "Réalisation"
        verbose_name_plural = "Réalisations"
        ordering = ['-created_at']

    def __str__(self):
        return self.title