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 simple tasks in
frontend code, you can use proxy models[1] and/or custom managers[2]. If
OTOH you're problem is exposing too much functionality to users, then it
would be up for you to refactor your code (especially forms) to better
target your users' needs.

Finally, Django shouldn't try to provide every feature for every use case,
lest it becomes flexible at the expense of "excellency", for the lack of a
better word. I'm not sure this is a problem for most Django users, so the
cost of having an extra middleware for a fringe use-case seems non-trivial
to me.

With all this in mind, I respectfully propose that this issue be handled at
the project/app level rather than by the framework as a whole.


Cheers,
AT

[0] http://www.python.org/dev/peps/pep-0020/
[1] https://docs.djangoproject.com/en/dev/topics/db/models/#proxy-models
[2]
https://docs.djangoproject.com/en/dev/topics/db/managers/#custom-managers-and-inheritance


On Tue, Oct 8, 2013 at 7:16 PM, Burak Emre Kabakcı <emrekaba...@gmail.com>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
> 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.
>
> It seems there are a lot of improvements in Django 1.5 I think there are
> more thing that may be revised. For example I think we should be able to
> set AUTH_USER_MODEL setting per module basis or namespaced routes basis.
>
> In order to solve this issue I needed to create a middleware class to
> change settings.AUTH_USER_MODEL; however I know that this is not the ideal
> solution because in each request I need to re-set one of the static Django
> settings. Here is the middleware class:
>
> class ChangeBaseUser(object):
>     def process_request(self, request):
>         match = resolve(request.path)
>         if match.app_name == "myapp":
>             settings.AUTH_USER_MODEL = 'myapp.Customer'
>         else:
>             settings.AUTH_USER_MODEL = 'auth.User'
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> 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/bd88babe-684e-4b5a-8b90-86963c40ffd5%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
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/CAKBiv3x9d_HwAkhkL27O0YTPgnTTAFt_z0FY-sJ0j0n9CY95Kw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to