Wednesday, August 26, 2015

Re: Django 1.7 migrations: Adding one field to User`s model


On 26 August 2015 at 20:09, Hugo Osvaldo Barrera <hugo@barrera.io> wrote:
Oh, so the field you're adding in monkey patching contrib.auth.User?
IMHO, the design problem isn't django, but rather monkey-patching models itself. Maybe you'd be better of using a custom user model.

I've tried to use custom user model, but Django forces me to change all FK`s. This is not possible for now.

I need to add just one column / field to existing User model. Nothing more, nothing less.

AFAIK I should create profile for user and put this column into profile model, but there are two disadvantages: 
  • the profile is not necessary now and will contain just one column (well, three when incl. PK and FK to user)
  • performance issues (joining table)
I think that for this use case "Custom user" will not work. I was wrong. I must forget about "Custom user". ;)

BR,
Marcin

--
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+unsubscribe@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.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAB2m7CzRVk%3DG-8JzHECbEH%3DZueP3BibBxZkV-vurBp3ND1aaZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment