I don't think it's necessary to duplicate the User model to accomplish what you want. Instead, you could write a model with the extra data you need, relate that to the built-in User model as a one-to-one relationship, and then write a custom auth backend which looks up the user using a field in your custom model.
_Nik On 2/21/2013 2:31 AM, Bino Oetomo wrote: > Dear All. > > I try to write what I call as 'l2auth' or '2nd Level Auth' > it's : > 1. because my application will be co-use by some 'company' > 2. because I want to delegate user administration to each company > 3. I want user login with username format as user@company (it is not > an email) > 4. Basically a copy-paste-modify from django auth. > > I made a pastebin of the app's models at http://pastebin.com/6iqCXJY6 > and this is what syncdb generate : http://oi50.tinypic.com/2rlz18p.jpg > > This is How I 'register' the my backend in settings.py > -------START---------- > AUTHENTICATION_BACKENDS = ('l2auth.backends.L2Backend', > 'django.contrib.auth.backends.ModelBackend', > ) > --------STOP---------- > > And this is my backend.py at http://pastebin.com/u1WVPV8s > > > I try to login : http://oi47.tinypic.com/20hx1sj.jpg > and it's failed : http://oi48.tinypic.com/35kv89c.jpg > > Next I do a test from django shell --> http://pastebin.com/C0Q7v0u5 > > Question : > 1. Did I missed somethings ? what is it ? > 2. Why the l2auth_l2user.password field did not hashed ? > > I realy appreciate any enlightment, clue, etc etc. > > Sincerely > -bino- > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.