To get object id currently modified in django administration

20 views
Skip to first unread message

Serge Alard

unread,
May 2, 2021, 9:02:28 AM5/2/21
to Django users
Bonjour

Je suis en train de faire des validations personnalisées sur des objets de mon projet dans l'administration de Django. Pour cela j'ai créé un ModelForm, mais je ne sais pas comment accéder à l'objet id en cours de modification dans l'administration de Django.
Pourriez-vous m'aider. Merci d'avance.


Hello

Currently I do customized validations on objects of my project in the Django administration. For that, I created a ModelForm but I do not know how to get the object id currently in modification in Django administration.
Could you help me. Thanks in advance.

Serge Alard

Ryan Nowakowski

unread,
May 2, 2021, 2:33:11 PM5/2/21
to django...@googlegroups.com
While in your ModelForm, check out self.instance.id
Reply all
Reply to author
Forward
0 new messages