Wednesday, August 26, 2015

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJV3gPmAAoJEC0ft5FqUuEhWSEQAJLNFNSxQI9CK4qWkiBsaLP4
iBQFUfkiK6FgacYaJ2JIMx3xP2r8CsFYNPFxgDzSUEqQ721ter1h0qkwxtD/bDqG
WX8nQphBWdHZ7dIneeR4+NMcsBlXalmLkPxDsYcO++H62f2RXp5LtAnUBZfBo949
5VHSd9BrNa3uzUsEgHX3TNqYysdOM10WYd9CfRinmUNpzXeEm90OPbKTdq36kNUG
gRNydrcNkRSWB9NJIz6p5pDCwZ0N2LXS17HP7grZho2gdzUIrqhOwRpVHqzG5517
/YzXYiMOu/EvriV/aPTD+x5zo7vQPmBH8H9igbU0fiyToeSIT42nd3FWNJF72rA/
vGsbVVGPHD08chMV0+yUtVvC4i/TsTHsJ18rVIL8ta38cn37QsvS68h1GmZaaBXU
xZ2BG+POCiz3TiDU2xO4h93Sz34ZuZ0APAv/cLBgjbebREIrV/t50XVWamn0uuCP
Jay/MBugDF4S+3prGLlwM7m7CrFyHznw+1/TRcnHqA+fls7lUSCcsKTn9CM1/WeD
qFeegXt5tQkY7EfIFOUynRHwkZ7I3+T9flVLOMwqqa3ovh9vJS8NyMPui3C4l1NM
Tm84900WVmfh9lmINxqKbjjzYKWboqXxAe9mdHb9Oszb/80IFYrYW5cCDWN/dUV6
W2J2wkEbw+NstoLeCBV4
=hsjL
-----END PGP SIGNATURE-----
On 08/26/2015 12:18 PM, Marcin Nowak wrote:
>
> On 26 August 2015 at 20:09, Hugo Osvaldo Barrera <hugo@barrera.io
> <mailto: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". ;)

Yes. I think the most important Django limitation here is how difficult
it is to switch from built-in User to custom User. That's a real
problem, and it should be fixed (but at the moment I'm not sure how to
fix it).

Better support for monkeypatching is not very interesting.

Carl

--
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/55DE03E6.9090300%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment