creecode:
I've tried your 2 suggestions with one with no results, and the second
suggestion perhaps i
did not understand enough of where the code should go to make it work.
************************************************************************************************
** Trigger adding instance to userprofile via passing profile_callback
in url.py
Tried this solution in both ...registration.url.py and
myproject.url.py but had syntax errors.
* 'profile_callback' as added to url.
ie.
url ( r'^accounts/register/$',
'registration.views.register',
{ 'profile_callback': UserProfile.objects.create },
name = 'registration_register' ),
( r'^accounts/', include ( 'registration.urls' ) ),
This provided numerous syntax errors, I tried it in both
mysite.myproject.url.py
and in the ...registration.url.py but to no avail. I tried it with 2
versions of registration, in the end though it seems ver .07 no
longer
uses this method.
**********************************************************************************
2nd Suggestion sounds elegant and since I'm using django 1
this method may work but I'm not sure where you mean to
put the code.
I would assume this code would be in mysite.myproject.models.py
class UserProfile.
def add_user_profile ( sender, instance, created, **kwargs ):
if created:
user_profile = UserProfile ( user = instance )
user_profile.save ( )
# Now this last line here confuses me is this supposed to go in
registration.model.py or ...myproject.model.py
models.signals.post_save.connect ( add_user_profile, sender = User )
whatever the case i've tried it in both and get nothing from
myproject.model.py
and when calling it from registration.model.py it returns an error
like
add_user_profile is not a global object.
Please advise
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---