Re: The key of permissions model

2017-04-27 Thread Flavio Curella
I'd like to take another try at this. My proposal is to temporarily supports two formats: the new `app_label.model_name.codename` (ref #25281) and the old `app.codename`. The old format will raise a PendingDeprecationWarning. Docs, code and tests will be updated to use the new format. I belie

Re: The key of permissions model

2012-09-23 Thread Hanne Moa
On 20 September 2012 16:11, Michael Manfre wrote: > The first argument could be either a string or a list of strings. Bad pattern. Then you must test for the existence of a string in order to avoid ('t', 'h', 'i', 's'). HM -- You received this message because you are subscribed to the Google

Re: The key of permissions model

2012-09-20 Thread Anssi Kääriäinen
On 20 syys, 17:11, Michael Manfre wrote: > Instead of get_permission('app_label.permission_name'), why not punt on the > problem > until schema migrations lands. Only provide a plural helper method that > always returns > a list. The first argument could be either a string or a list of strings. >

Re: The key of permissions model

2012-09-20 Thread Michael Manfre
Instead of get_permission('app_label.permission_name'), why not punt on the problem until schema migrations lands. Only provide a plural helper method that always returns a list. The first argument could be either a string or a list of strings. This leaves it up to the caller to determine what

Re: The key of permissions model

2012-09-19 Thread Anssi Kääriäinen
On 20 syys, 01:47, Donald Stufft wrote: > Can't you add the constraint in both code and in the DB. On older sites > the constraint just won't exist in the DB (Could include it in the release > notes so people can add it to existing sites if they wish). Unfortunately no - the app label doesn't exi

Re: The key of permissions model

2012-09-19 Thread Donald Stufft
Can't you add the constraint in both code and in the DB. On older sites the constraint just won't exist in the DB (Could include it in the release notes so people can add it to existing sites if they wish). On Wednesday, September 19, 2012 at 6:40 PM, Anssi Kääriäinen wrote: > We use the style

The key of permissions model

2012-09-19 Thread Anssi Kääriäinen
We use the style of "app_label.permission_name" in multiple places of our code to refer to given auth.models.Permission. However, there is no unique key for that combination, the key is content_type, permission_name. I verified that it is actually possible to hit this problem by using the Meta.perm