views:

146

answers:

1

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?

+1  A: 

As a workaround, Since, It is likely that you have a FK to User, so you could define an InlineModel on the User model.

Otherwise, the easiest approach may be to create a custom admin view since, there isn't a generic admin view that displays and saves formsets.

Lakshman Prasad
Unfortunately I don't have any FK's in this model so this does not work form me. I will find out if it is possible to plug the custom view into django's admin.
skrobul