django-admin - how to modify ModelAdmin to create multiple objects at once?
Posted
by skrobul
on Stack Overflow
See other posts from Stack Overflow
or by skrobul
Published on 2010-06-07T22:09:20Z
Indexed on
2010/06/07
22:12 UTC
Read the original article
Hit count: 524
let's assume that I have very basic model
class Message(models.Model):
msg = models.CharField(max_length=30)
this model is registered with admin module:
class MessageAdmin(admin.ModelAdmin):
pass
admin.site.register(Message, MessageAdmin)
Currently when I go into the admin interface, after clicking "Add message" I have only one form where I can enter the msg
.
I would like to have multiple forms (formset perhaps) on the "Add page" so I can create multiple messages at once. It's really annoying having to click "Save and add another" every single time.
Ideally I would like to achieve something like InlineModelAdmin
but it turns out that you can use it only for the models that are related to the object which is edited.
What would you recommend to use to resolve this problem?
© Stack Overflow or respective owner