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', ([], {'max_length': '(255)'}), False, 'from django.db import models\n'), (13, 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)'}), False, 'from django.db import models\n'), (14, 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'default': 'timezone.now'}), False, 'from django.db import models\n'), (15, 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)'}), False, 'from django.db import models\n'), (16, 'django.db.models.ForeignKey', 'models.ForeignKey', (['Categoria'], {'on_delete': 'models.DO_NOTHING'}), False, 'from django.db import models\n'), (17, 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), False, 'from django.db import models\n'), (18, 'django.db.models.ImageField', 'models.ImageField', ([], {'blank': '(True)', 'upload_to': '"""fotos/%y/%m/"""'}), False, 'from django.db import models\n')]