AUTH_USER_MODEL should point to your model class, not the model admin
use
AUTH_USER_MODEL = 'user_text.User'
Assuming that the app where the User model lives is called "user_text"
On Sat, Jul 29, 2017 at 12:56 PM, Binny Zupnick wrote:
> I've tried many things, but I'll write what I currently
I've tried many things, but I'll write what I currently have implemented.
admin.py
admin.site.register(User, UserAdmin)
models.py
class User(AbstractUser):
phone = models.CharField(max_length=40, unique=True)
settings.py
AUTH_USER_MODEL = 'user_text.UserAdmin'
I do `makemigrations` and I'm get
If the fields you're adding are things that you need to know for purposes
of figuring out who someone is and what they're allowed to do, put them in
a custom User model.
If the fields you're adding are not for the purpose of figuring out who
someone is and what they're allowed to do, put them in a
I suggest creating a profile, leave the auth.User only for auth, all else
specific to you application use your own model and reference to that
On Tue, Jul 18, 2017 at 9:48 AM, 李余通 wrote:
> How to extend User?I find many ways;
> 1. Use Profile
> eg:
>
> class UserProfi
How to extend User?I find many ways;
1. Use Profile
eg:
class UserProfile(models.Model):
user = models.OneToOneField(User)
major = models.TextField(default='', blank=True)
This way is easy to understand,However,it will create a new table in sql,I
heard this will add Sys
Hi
2012/7/14 Melvyn Sopacua
>
> Important question: Why?
>
>
I need to store more information about the user, like birthday, language
preference etc
Moreover I need to have two different users and store different
information for each user type.
In a near future I will need to integrate auth an
On 14-7-2012 0:18, sdonk wrote:
> I'm starting a new project and for the first time I need to extend the User
> model.
Important question: Why?
> I read the documentation and I googled a lot to try to figure out what is
> the best approach but I got confused.
>
> What's the the best approach?
Hi!
I prefer using OnetoOne with a pre_delete signal to remove user from a
pirncipal object instance:
from django.contrib.auth.models import User
from django.db.models.signals import pre_delete
from django.dispatch import receiver
class Customer(User):
user = models.OneToOneField(User)
@rec
Hi,
I'm starting a new project and for the first time I need to extend the User
model.
I read the documentation and I googled a lot to try to figure out what is
the best approach but I got confused.
What's the the best approach?
Class inheritance:
from django.contrib.gis.db import models
from
Personally I think get_profile() is an anti-pattern, just access it
like any other OneToOneField (and that's what you want... not
unique=True on a ForeignKey). Just set up a models.OneToOneField(User,
related_name=XXX), then you can access the profile as user.XXX. The
User model and all of its asso
I'm reading up on extending the user model and planing out a project
and wanted to clarify a point.
I want to have a single user list to authenticate using the standard
user model.
I want then to create multiple apps in the project, each with roles
and permissions tied to the user defined in the us
I have extended the django user model with a "Member" model. I would
like to be able to administer (on admin site) the user - all data from
both models. I need the email and name from User, but everything else
is from "Member". I have set it up so that I can get all the data on
one form, but I cann
On Mar 26, 12:53 pm, Antonio Sánchez wrote:
> Yeah sure, i should have used "recommended" word instead of correct.
>
> The difference between link i wrote and b-list is that the last one
> uses a foreign-key, while first uses one-to-one, and this is the way
> is recommended in doc, so... I think i
Yeah sure, i should have used "recommended" word instead of correct.
The difference between link i wrote and b-list is that the last one
uses a foreign-key, while first uses one-to-one, and this is the way
is recommended in doc, so... I think i will follow that post
recommendations.
Thanks again!
On Friday, March 25, 2011 01:16:51 pm Nick Serra wrote:
> Andre's solution is out of date. Calvin is correct, use the user
> profile model that is built into django auth. OP, the link you found
> is correct.
>
> >
> > http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-m...
> >
>
Andre's solution is out of date. Calvin is correct, use the user
profile model that is built into django auth. OP, the link you found
is correct.
On Mar 25, 11:39 am, Andre Terra wrote:
> This is the correct way:
>
> http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-m...
>
> Sin
This is the correct way:
http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-model/
Sincerely,
Andre Terra
On Fri, Mar 25, 2011 at 11:26 AM, Antonio Sánchez wrote:
> i have found this:
> http://digitaldreamer.net/blog/2010/12/8/custom-user-profile-and-extend-user-admin-
i have found this:
http://digitaldreamer.net/blog/2010/12/8/custom-user-profile-and-extend-user-admin-django/
do you think its the correct way??
thanks for your reply!
On Mar 25, 2:12 pm, Calvin Spealman wrote:
> The auth app includes support to use a profile model, configured w
The auth app includes support to use a profile model, configured with
AUTH_PROFILE_MODULE in settings, which the docs show you how to use.
Yes you can use inheritance, but you might assume it is a good idea to
use what the auth app promotes.
On Fri, Mar 25, 2011 at 9:04 AM, Antonio Sánchez wrote:
hi! i have a question, which is the best option about extending user model??
here:
http://docs.djangoproject.com/en/1.2//topics/auth/#storing-additional-information-about-users
they say to create a manual OneToOneField between models and some more
stuff,
but here:
http://docs.djangoproject.
I need some more info :)
I've get this: http://img138.imageshack.us/img138/200/descargan.png it's
pretty but need to change somethings...
1. *I need that user be a EmailField unique. User is defined in auth.User
so I don't know how change it.*
2. In "User Profiles" I like to change the t
Perfect, thanks for your help!
On Tue, May 18, 2010 at 14:03, zinckiwi wrote:
> On May 18, 7:57 am, Alexandre González wrote:
> > But don't you think that have attributes that I don't need is a
> perfomance
> > lost? I only ask, I'm learning django :)
> >
> > I go to see the documentation that
On May 18, 7:57 am, Alexandre González wrote:
> But don't you think that have attributes that I don't need is a perfomance
> lost? I only ask, I'm learning django :)
>
> I go to see the documentation that you send me, thanks for your help.
There will be a minuscule amount of overhead from the que
But don't you think that have attributes that I don't need is a perfomance
lost? I only ask, I'm learning django :)
I go to see the documentation that you send me, thanks for your help.
On Tue, May 18, 2010 at 13:38, Ian Lewis wrote:
> If you don't need the name, surname etc. then don't use the
If you don't need the name, surname etc. then don't use them. They are
optional fields. You can also implement a custom form or view when the
user registers that can make sure the email has not been previously
registered.
If you need to add additional fields then you should create a custom
profile
Hi everybody!
I need a User model with normal attributes inherit from models.User, but I
need some differences:
- I dont' need name, surname and another attributes
- I need that email are unique between different Users
Can I inherit and use most of models.User? Or I need to create a new cl
On Tue, Jan 13, 2009 at 9:14 PM, ldm999 wrote:
>
> I need some extra fields on User and my first assumption was I could
> subclass user (yes, I am a newbie). Then I read the docs and they talk
> about using UserProfile. This article (http://scottbarnham.com/blog/
> 2008/08/21/extending-the-django
I need some extra fields on User and my first assumption was I could
subclass user (yes, I am a newbie). Then I read the docs and they talk
about using UserProfile. This article (http://scottbarnham.com/blog/
2008/08/21/extending-the-django-user-model-with-inheritance/
#comment-621) seems to say t
I moved to creating the model with a OneToOne relationship rather than
a foreign key and have it got it to work. Not sure why I was having
problems as Foreign Key
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Dj
Do you also have lines like this?
class Admin:
pass
http://www.djangoproject.com/documentation/tutorial2/
Paul Prescod
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to thi
On Mon, 2006-10-23 at 16:38 +, rp wrote:
>
> These posts are very helpful:
>
> http://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-model
>
> http://www.b-list.org/weblog/2006/09/02/django-tips-user-registration
>
> Both suggest using OneToOneField instead of ForeignKey:
>
These posts are very helpful:
http://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-model
http://www.b-list.org/weblog/2006/09/02/django-tips-user-registration
Both suggest using OneToOneField instead of ForeignKey:
user = models.OneToOneField(User)
instead of:
user = model
I am trying to extend the User Model.
I've created a new app (userprofiles) and added this to my settings.
I've then created the models.py (see below)
At first II tried the following (User, unique=True,
edit_inline=models.TABULAR, num_in_admin=1,min_num_in_admin=1,
max_num_in_admin=1,num_extra_o
Has this problem been solved? I've been fighting this problem forever.
Everything seems to work but no matter what i do the data in the new
class never gets saved. I would really love to see some instructions in
the documentation.
--~--~-~--~~~---~--~~
You receive
Bryan,
this won't work either, because when you try to save the user using
admin you will have this kind of error:
Request Method: POST
Request URL:http://localhost:8000/admin/auth/user/40/
Exception Type: TypeError
Exception Value:Cannot resolve keyword 'name' into f
You can extend the user model in m-r using a ForeignKey with
edit_inline, num_in_admin=1, max_num_in_admin=1, and unique=True. This
is what my dev team uses to add additional fields to users.
Conceptually, a OneToOneField would probably make more sense, but it
seems that OneToOneField is still be
Hi Arthur,If I will use OneToOne then in admin it wolud be not possible to edit users, which is not in 'myusers' ( using edit_inline) and if disable edit_inline then I sholud edit 'myusers' in to places one in 'users' and then in 'myusers'.
in that case better to use 'ForeignKey' or may be it is ex
hi michael.
inheritance is not working yet in magic-removal. the confusing thing
about it is you can create the class and the table does get created,
but when you access the same class later in your python code, it will
be treated as the super class (User in your case).
Extending User is a very
Hi all!
What would be the best way to extend User class?
subclassing makes another table and wiki ->
http://www.djangoproject.com/documentation/models/subclassing/
different from m-r.
remove_fileds dosen't work and in admin it is possible to add info to
new class but not to modify i
39 matches
Mail list logo