python - How do I display a confirmation message after a custom admin action with an intermediate page (in Django)? -


The underlying actions that come with Django Administrator usually display useful messages after performing the top, e.g. Saying that a new object was added or what you did.

Show how to do this with simple actions to be displayed in the form of custom Edman methods, however, that intermediate pages are required with custom actions (cover on the same page and below) ), I am encouraged to pass the user to another view. It is very good, but that means I do not have access to the custom modelAdmin instance so that I The message_user () method can call ... or at least I do not need to make sure that how do I get it. / P>

Can you please tell me how to get possession of the present modelAdmin instance, or if there is a better way, then one of the other useful scenes is displayed when I am in the second view. Will happen? To emulate the

 

django.contrib messages.info (request, message)

Adding a message is documented here and the way the ModelAdmin uses it can be seen here:

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

ruby on rails - Convert a Activerecord result with has_one associations into a single hash per record -

javascript - Read complete data from stream from onMessage -