Jeff Watkins wrote:
> Always on the lookout for ways to simplify the Identity framework, I
> thought about allowing developers to specify their Identity model
> classes directly rather than by specifying the name of the module and
> then the names of the classes. So instead of:
>
> identity.soprovider.model="project.model"
> identity.soprovider.model.user="MyUser"
> identity.soprovider.model.group="MyGroup"
> identity.soprovider.model.permission= "MyPermission"
>
> You could have:
>
> from project.model import *
> identity.soprovider.model.user= MyUser
> identity.soprovider.model.group= MyGroup
> identity.soprovider.model.permission= MyPermission
>
> However, it turns out that the model imports the identity module,
> which has a soprovider module and so the config file doesn't actually
> wind up with the right value.
>
> My temporary solution is to use the fully qualified module names:
>
> import project.model
> identity.soprovider.model.user= project.model.MyUser
> identity.soprovider.model.group= project.model.MyGroup
> identity.soprovider.model.permission= project.model.MyPermission
>
> This sure feels like a bug and I'll file a ticket once Trac comes
> back online.

What about:

from project import model
identity.soprovider.model.user= model.MyUser
identity.soprovider.model.group= model.MyGroup
identity.soprovider.model.permission= model.MyPermission

I don't know if this could be considered a bug, import * it's not the
best solution and can cause namespace collisions.

Ciao
Michele

Reply via email to