Ashy,

The question what do you want to do with the data is important. When you do
Userdata.objects.all() you will get back all the data from both tables.  How
you access it is different.

u = Userdata.objects.all()[0]
u.user.name is going to return the name from the User model.

u being the UserData object
user being the foreign key to the User model
name being the field from the User model

I hope this helps

On Mon, Sep 13, 2010 at 1:20 PM, ashy <ashwinmo...@gmail.com> wrote:

> Yes, I know that.
> What is the object oriented way of getting the data from both the
> tables based on the foreign key?
>
> thanks for any help.
>
> --
> 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<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Guadajuko! Vamos a correr!
 -"Cool! we are going to run!"

-- 
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