Mike Dewhirst
unread,Nov 16, 2015, 12:33:16 AM11/16/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
I've been trying to figure out why I can't delete child records
displayed in the Admin. Finally tracked it down to this method in
admin.py which when commented out restores the ability to check the
Delete box and get rid of the child record on clicking Save.
def save_formset(self, request, form, formset, change): """ this updates
the related records when they change """ instances =
formset.save(commit=False) for instance in instances: try:
instance.modified_by = request.user except Exception: # some instances
don't have modified_by pass instance.save() formset.save_m2m()
How can I keep this and get Delete to work in the Admin?
Thanks
Mike