THanks Doug
>
> 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)
> ...
>
> c
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
hi collin,
On Aug 10, 11:26 am, Collin Grady <[EMAIL PROTECTED]> wrote:
> What do you mean by "get the history" ?
the employee could have new contract & assignment as months goes by.
the employee_contract & employee_assignment tells of their recent
contract & assignment. while the employee attri
What do you mean by "get the history" ?
--~--~-~--~~~---~--~~
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 e
hi,
On Aug 9, 11:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> He means that you can remove:
>
> employee = models.ForeignKey(Employee)
>
> from your 'EmployeeAssignment' and 'EmployeeContract' models because
> the relationship is already defined in your 'Employee' model. You can
>
He means that you can remove:
employee = models.ForeignKey(Employee)
from your 'EmployeeAssignment' and 'EmployeeContract' models because
the relationship is already defined in your 'Employee' model. You can
use reverse relations to get the relation instead.
On Aug 8, 10:58 pm, james_027 <[
Hi collin
On Aug 9, 1:06 pm, Collin Grady <[EMAIL PROTECTED]> wrote:
> Because you have an infinite loop there.
>
> Why are you linking both directions? There's a reverse relation
> available to get from EmployeeAssignment and EmployeeContract back to
> the Employee model, you don't need to expli
Because you have an infinite loop there.
Why are you linking both directions? There's a reverse relation
available to get from EmployeeAssignment and EmployeeContract back to
the Employee model, you don't need to explicitly define it.
--~--~-~--~~~---~--~~
You re
hi,
I have this model which doesn't work when using select_related(). What
happen is django seems to be in a infinite loop.
class Employee(models.Model):
employee_contract = models.ForeignKey('EmployeeContract',
related_name='contracted_employee')
employee_assignment = models.ForeignKey
9 matches
Mail list logo