Re: Dynamic AUTH_USER_MODEL based on modules or routes

2016-05-24 Thread farhah . zm
The original post was in 2013 and today is 2016. I had the same problem as yours and I managed to find a solution. In case anyone is still wondering on how to tackle this problem, here is my solution. from django.apps import apps User = apps.get_model(app_label=yourapplabel,

Re: Dynamic AUTH_USER_MODEL based on modules or routes

2013-10-10 Thread gavinwahl
> The current User model is great for admin panel users but in frontend it may become extra overhead for some cases. People try to create another user attribute models and use extra joins to be able to keep extra attributes (city, ip, locale etc.) for their users. Use the user-profile

Re: Dynamic AUTH_USER_MODEL based on modules or routes

2013-10-09 Thread Russell Keith-Magee
On Thu, Oct 10, 2013 at 9:06 AM, Burak Emre Kabakcı wrote: > Again, thanks for the other alternatives. > > Today, I have worked with auth.backends.ModelBackend and it seems it would > be possible to separate user resources (like if the route namespace is > "myapp", then go

Re: Dynamic AUTH_USER_MODEL based on modules or routes

2013-10-09 Thread Burak Emre Kabakcı
Again, thanks for the other alternatives. Today, I have worked with auth.backends.ModelBackend and it seems it would be possible to separate user resources (like if the route namespace is "myapp", then go with Customer table) if get_user(self, user_id) method is called with request parameter.

Re: Dynamic AUTH_USER_MODEL based on modules or routes

2013-10-09 Thread Russell Keith-Magee
On Thu, Oct 10, 2013 at 6:00 AM, Burak Emre Kabakcı wrote: > Thanks for the suggestions. > > @Andre Terra I figured out that my solution doesn't work actually. Custom > managers is not useful in my case because underlying auth system is still > same, it means it will also

Re: Dynamic AUTH_USER_MODEL based on modules or routes

2013-10-09 Thread Burak Emre Kabakcı
Thanks for the suggestions. @Andre Terra I figured out that my solution doesn't work actually. Custom managers is not useful in my case because underlying auth system is still same, it means it will also use same same session tables, cookies etc. @Russell Keith-Magee Sorry, I couldn't

Re: Dynamic AUTH_USER_MODEL based on modules or routes

2013-10-08 Thread Russell Keith-Magee
On Wed, Oct 9, 2013 at 6:16 AM, Burak Emre Kabakcı wrote: > It would be nice if you allow using two different models for > django.contrib.auth module. The current User model is great for admin panel > users but in frontend it may become extra overhead for some cases. People

Re: Dynamic AUTH_USER_MODEL based on modules or routes

2013-10-08 Thread Andre Terra
Hi, Burak, I'm not sure if you're problem is one of too much cruft in *frontend-related code* or in *user-facing content* but, in any case, it seems to me that "there should be one-- and preferably only one --obvious way to do it." [0] Moreover, If you're having to deal with complex models for

Dynamic AUTH_USER_MODEL based on modules or routes

2013-10-08 Thread Burak Emre Kabakcı
It would be nice if you allow using two different models for django.contrib.auth module. The current User model is great for admin panel users but in frontend it may become extra overhead for some cases. People try to create another user attribute models and use extra joins to be able to keep