Uploading images in Django

1

How to upload more than 1 image in django Admin? This is my mode:

    from django.db import models

class Imovel(models.Model):
    titulo = models.CharField('Titulo', max_length=200, blank=False)
    slug = models.SlugField('Slug')
    cep = models.IntegerField('CEP', blank=False)
    estado = models.CharField('Estado', max_length=50, blank=False)
    cidade = models.CharField('Cidade', max_length=50, blank=False)
    bairro = models.CharField('Bairro', max_length=200, blank=False)
    endereco = models.CharField('Endereço', max_length=300, blank=False)
    telefone = models.IntegerField('Telefone')
    descricao = models.TextField('Descrição')
    tipo = models.CharField('Tipo', max_length=20)
    quartos = models.IntegerField('Quartos')
    vaga_garagem = models.IntegerField('Vagas na Garagem')
    fotos = models.ImageField('Fotos',
                              upload_to='imagens/%Y/')


    def __str__(self):
        return self.titulo
    
asked by anonymous 06.10.2017 / 03:19

0 answers