maybe something like this...

class Employee(models.Model):
     # your employee model fields here, no FKs to Contact or
Assignment models
     ...

class EmployeeAssignment(models.Model):
    active = models.BooleanField()  # I added this
    employee = models.ForeignKey(Employee)
    ...

class EmployeeContract(models.Model):
    active = models.BooleanField()  # I added this
    employee = models.ForeignKey(Employee)
    ...

then you could do

bob = Employee.objects.get(pk=1)
current_contacts = bob.employeecontract_set.filter(active=True)
current_assignments = bob.employeassignment_set.filter(active=True)

I added the active flag to differentiate history vs current


--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to