Add multiple objects of same model at the same time in the django admin

823 Views Asked by At

I have a model to upload pictures:

class Snap(models.Model):
    image = models.ImageField(upload_to=get_upload_file_name)
    caption = models.CharField(max_length=150, blank=True, null=True)
    pubdate = models.DateTimeField(default=timezone.now)

In the admin it contains all the Snap's field (i.e. one field to upload an image ,its caption and the pubdate) which is as expected. How do I add multiple record of Snap's in one go. I hope I was clear, if not please ask. Your help and guidance will be very much appreciated. Thank you.

admin.py:

class SnapAdmin(admin.ModelAdmin):
    class Meta:
        model = Snap

admin.site.register(Snap, SnapAdmin)
0

There are 0 best solutions below