Re: One-One relationship

2006-06-30 Thread ama55
Thanks Bryan: i will try to do that. and i will be glad if i u can post ur app thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@google

Re: One-One relationship

2006-06-30 Thread Bryan Chow
You can import User from django.contrib.auth.models The save method of the Person class needs to create a User object programatically, e.g. User.objects.create_user(username, email, password) Then you can call super(Person, self).save() This should give you enough to figure out the rest, but if

Re: One-One relationship

2006-06-30 Thread ama55
hi i have create the a save method, to add the user. but the user cannot be accessed from the person class. this is the code any suggestion to correct it: from django.db import models import datetime class Persons (models.Model): user = models.OneToOneField(Users) firstName = models.Char

Re: One-One relationship

2006-06-29 Thread Bryan Chow
1. Override the save() method in your person class to create a user object if one does not yet exist. 2. Try "True" with a capital T. 3. Should be solved by point 1. Hope this helps :) Bryan --~--~-~--~~~---~--~~ You received this message because you are subsc

One-One relationship

2006-06-29 Thread ama55
Hi: i am trying to establish a one to one relationship between 2 tables, i am using the OneToOneFields in the models.py, this is working in the first time. but the problems are as follows: 1) how can i force the person to create a user every time? (person and user are the 2 tables in the database)