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

[((107, 139), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)'}), '(max_length=255)\n', (123, 139), False, 'from django.db import models\n'), ((228, 260), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)'}), '(max_length=255)\n', (244, 260), False, 'from django.db import models\n'), ((280, 322), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'default': 'timezone.now'}), '(default=timezone.now)\n', (300, 322), False, 'from django.db import models\n'), ((339, 367), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)'}), '(blank=True)\n', (355, 367), False, 'from django.db import models\n'), ((384, 441), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Categoria'], {'on_delete': 'models.DO_NOTHING'}), '(Categoria, on_delete=models.DO_NOTHING)\n', (401, 441), False, 'from django.db import models\n'), ((456, 490), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (475, 490), False, 'from django.db import models\n'), ((502, 557), 'django.db.models.ImageField', 'models.ImageField', ([], {'blank': '(True)', 'upload_to': '"""fotos/%y/%m/"""'}), "(blank=True, upload_to='fotos/%y/%m/')\n", (519, 557), False, 'from django.db import models\n')]