I use Grappelli as a custom admin sites plugin...
I use hard-coded button in list_display in the each field which looks like this
def approve_button(self):
return u"<input type='button' class='grp-button' value='%s' onclick='if (confirm(\"%s\")){django.jQuery.get(\"/approve/%s/%s/\", function(data){alert(data);})}'>" % (_("Approve"), _("Are you sure you want to approve this request?"), self.id, self.license_ticket.id)
approve_button.allow_tags = TrueThe problem is, that I have list_editable ForeignKey and I want to choose an element from the list, hit the button and send self.license_ticket.id to /approve/%s/%s. Sending id is simple, but the list has to be saved after clicking on the Approve button.
One solution is to choose from the list, hit the Save button at the bottom of the page and then hit the Approve button, which is solution I don't like.