Re: Specifying modelform meta field as get_user_model() in 1.7

2014-10-21 Thread Collin Anderson
Hi Derek,

Interesting. Do you know why it's trying to import your form before the app 
registry is ready? It seems to me it might be possible to delay until after 
the app registry is ready. Could you post a traceback?

Thanks,
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+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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/15d8799d-d40c-4563-a9b2-75e3c6e87434%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Specifying modelform meta field as get_user_model() in 1.7

2014-10-20 Thread Derek Leverenz
Hi,

I'm working on porting our codebase to django 1.7, and we use a custom user 
model. For that, we need to override the user creation and password reset 
forms. 
For the form's Meta class, we have

class Meta:
model = get_user_model()


where get_user_model is imported form django.contrib.auth. Because of 
changes made in 1.7, that can no longer be called at import time because 
the app registry is not ready. The troubleshooting section of the 1.7 
update notes suggests using settings.AUTH_USER_MODEL instead, however that 
doesn't work in this case, as far as I can tell. 

The only workaround I have come up with is simply to directly reference the 
custom user model. This will probably work fine for us, but it seems like 
it could cause problems for libraries, since they wont know what the custom 
model is. Is there a workaround for this? I'm not sure if I am just missing 
something.

thanks

--Derek Leverenz

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2e1a3233-eee9-4cc3-928e-ff77fcc50bc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.