Historically there's been pushback against adding new settings. That said, 
I don't see an alternative here besides perhaps an AppConfig attribute 
(last discussed in 
https://groups.google.com/d/topic/django-developers/qnnCLppwA3o/discussion). 
Perhaps we should try to move the existing auth settings to the AppConfig 
and see if that works. I guess it won't be a trivial effort though, and not 
sure it should block new features like this.

On Wednesday, July 8, 2015 at 4:25:53 AM UTC-4, Григорий Крамаренко wrote:
>
> I thought of something better:
>
> # Add to conf.global_settings.py 
> <http://www.google.com/url?q=http%3A%2F%2Fconf.global_settings.py&sa=D&sntz=1&usg=AFQjCNHfbNuKs7PSyzFR99bwgZwLWb6QCQ>
> ...
> CUSTOM_DEFAULT_PERMISSIONS = ()
> ...
>
> # And add in db.models.options.py
>
> def get_full_default_permissions():
>     perms = ['add', 'change', 'delete']
>     perms.extend([ x for x in settings.CUSTOM_DEFAULT_PERMISSIONS if not 
> x in perms ])
>     return perms
>
> @python_2_unicode_compatible
> class Options(object):
>     ...
>
>
>     def __init__(self, meta, app_label=None):
>         ...
>         self.default_permissions = get_full_default_permissions()
>         ...
>
>
> so, we killed two birds with one stone... ;)
>
>
> среда, 8 июля 2015 г., 18:02:47 UTC+10 пользователь Григорий Крамаренко 
> написал:
>>
>> Another variant:
>>
>> # Add to conf.global_settings.py 
>> <http://www.google.com/url?q=http%3A%2F%2Fconf.global_settings.py&sa=D&sntz=1&usg=AFQjCNHfbNuKs7PSyzFR99bwgZwLWb6QCQ>
>> ...
>> AUTH_DEFAULT_PERMISSIONS = ('add', 'change', 'delete')
>> ...
>>
>> # And in db.models.options.py
>>
>>
>> @python_2_unicode_compatible
>> class Options(object):
>>     ...
>>
>>
>>     def __init__(self, meta, app_label=None):
>>         ...
>>         self.default_permissions = settings.AUTH_DEFAULT_PERMISSIONS
>>         ...
>>
>>
>> Nothing will change in the distribution. Not default. But will cover my 
>> need.
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/d9785400-0831-43ac-8ba5-0acec35fdc72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to