开发者

Django: How to "extend" Group creation using Signals?

开发者 https://www.devze.com 2023-01-27 05:16 出处:网络
I am not sure if I am asking the right question. But is it possible to add \"behaviors\" when creating a Group in Django? I want want to create directories/files after creating a Group in the admin pa

I am not sure if I am asking the right question. But is it possible to add "behaviors" when creating a Group in Django? I want want to create directories/files after creating a Group in the admin panel.

The "additional" behaviors (creating the directory/file) can happen after the Group was successfully added in the database or after the POST was successf开发者_JAVA百科ul (?).

Thanks! Wenbert


Yes. Catch the post_save signal for the Group model, then do your processing in there.

0

精彩评论

暂无评论...
验证码 换一张
取 消