Friday, November 28, 2014

Re: Using data migration to create initial users errors

Hey all together,

unfortunately there isn't a way to add users through their manager in RunPython yet. The only solution I can see so far, is doing it manually, e.g. doing what your `create_user` method does inside RunPython. There is a patch though #23822 [1] that needs some tests and docs, but hopefully makes it into 1.8.

[1] https://code.djangoproject.com/ticket/23822

/Markus

On Friday, November 28, 2014 11:47:24 AM UTC+1, Guillaume Cisco wrote:
Did you find a way to use method create_user in a data migration?
I can't see a way to import the manager for using it.

Le jeudi 16 octobre 2014 23:19:43 UTC+2, Collin Anderson a écrit :
Hi Ben,

Yes, the custom manager objects are not available within migrations. I bet you might be able to import the UserManager and stick it on the User model yourself.

Collin

--
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/39df0514-e249-467c-8ad6-c0ff1f6151b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment