from django.db import models
from doucoder import settings

# Create your models here.

class CategorieReal(models.Model):
    nom = models.TextField(max_length=50,default='')
    def __str__(self):
        return self.nom

class FastMovieYoutube(models.Model):
    title = models.TextField(max_length=50,default='')
    link = models.TextField(max_length=255,default='')
    
    def __str__(self):
        return self.title


class Realisation(models.Model):
    
    imageMiseEnAvant = models.ImageField(upload_to='images/', blank=True, null=True   )
    nom = models.TextField(max_length=50)
    link = models.TextField(max_length=255,blank=True,null=True , default='')
    click = models.IntegerField(default=0)
    
    description = models.TextField(max_length=255,blank=True,null=True , default='')
    categorie = models.ForeignKey(CategorieReal,on_delete=models.DO_NOTHING,default=None)

    def __str__(self):
        return self.nom
    
