from django.db import models
from django.utils import timezone


class Categoria(models.Model):
    nome = models.CharField(max_length=255)

    def __str__(self):
        return self.nome


class Item(models.Model):
    nome = models.CharField(max_length=255)
    data_criacao = models.DateTimeField(default=timezone.now)
    descricao = models.TextField(blank=True)
    categoria = models.ForeignKey(Categoria, on_delete=models.DO_NOTHING)
    ocultar = models.BooleanField(default=False)
    foto = models.ImageField(blank=True, upload_to='fotos/%y/%m/')

    def __str__(self):
        return self.nome

[(6, 'django.db.models.CharField', 'models.CharField', False, 'from django.db import models\n'), (13, 'django.db.models.CharField', 'models.CharField', False, 'from django.db import models\n'), (14, 'django.db.models.DateTimeField', 'models.DateTimeField', False, 'from django.db import models\n'), (15, 'django.db.models.TextField', 'models.TextField', False, 'from django.db import models\n'), (16, 'django.db.models.ForeignKey', 'models.ForeignKey', False, 'from django.db import models\n'), (17, 'django.db.models.BooleanField', 'models.BooleanField', False, 'from django.db import models\n'), (18, 'django.db.models.ImageField', 'models.ImageField', False, 'from django.db import models\n')]