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.
精彩评论