开发者

Restrict a user from creating more than 'n' customers in Django admin

In Django admin, how can I restrict a user from creating more than 'n' customers开发者_C百科?


if customer is added to the main model as an InlineModel, then you just need to specufy max_num property (docs).

If this is a main model (not inline), the simplest is IMHO to override ModelAdmin's save method and check if adding additional customer is allowed.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜