[Fixed]-ID Attribute Error Django Admin in Change Form

1👍

✅

You can do with original. No need of setting nation_id

 def render_change_form(self, request, context, *args, **kwargs):
        if context.get('original'): #
             obj = context['original']
             #this will be the object you are trying to update
        return super(NationAdmin, self).render_change_form(request, context, *args, **kwargs)

Leave a comment