On Mon, Jan 4, 2010 at 11:00 PM, Marc Aymerich <[email protected]> wrote:
> class user(models.model):
> person = models.OneToOneField(person)
I presume that you meant:
person = models.OneToOneField(employee)
Is so, then greatlemer's method will work.
Or, especially if you will have use for the employee objects too, and
since company and user do not have a direct relation, you must find
an employee first:
company_instance.employee_set_all()
Then you can find the users from the employee instances. (But see
select_related to improve performance by getting it all done in one
database query.)
Bill
--
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.