Hi Djangos,

i am attaching a UserProfile to my Users
by using a post_save signal:

class UserProfile(models.Model):
    user = models.ForeignKey(User, unique=True)
    address = models.ForeignKey(Address, blank=True, null=True)

def user_post_save(sender, instance, signal, *args, **kwargs):
    profile =
UserProfile.objects.get_or_create(user=instance,address=None)

now when the User is created he doesn't need an address,
as we gather this info later, but even with null=True or blank=True
i will get:

IntegrityError at /admin/auth/user/add/
orderbook_userprofile.address_id may not be NULL

is there another way of creating UserProfiles this way without having
to
fill them with infos already?

mange tak
kalinski


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to