Hi,

I am trying to migrate an existing application to django. I am
encountering the following problem with this models

D:\private\james\documents\django\ksk>python manage.py validate
manning.employee: Reverse query name for field 'employee_contract'
clashes with field 'EmployeeContr
act.employee'. Add a related_name argument to the definition for
'employee_contract'.
manning.employee: Reverse query name for field 'employee_assignment'
clashes with field 'EmployeeAss
ignment.employee'. Add a related_name argument to the definition for
'employee_assignment'.
2 errors found.

class Employee(models.Model):
    lastname = models.CharField(maxlength=30)
    firstname = models.CharField(maxlength=30)
    middlename = models.CharField(blank=True, maxlength=30)
    gender = models.CharField(maxlength=1)
    birthday = models.DateField()
    contact_no = models.CharField(blank=True, maxlength=50)
    address = models.CharField(maxlength=100)
    notes = models.CharField(maxlength=200)
    pay_by = models.CharField(maxlength=3, choices=PAY_BY_LIST)
    hour_rate = models.DecimalField(max_digits=7,
decimal_places=2)
    allowance = models.DecimalField(max_digits=7,
decimal_places=2)
    account_no = models.CharField(blank=True, maxlength=20)
    sss = models.CharField(blank=True, maxlength=20)
    phil_health = models.CharField(blank=True, maxlength=20)
    pag_ibig = models.CharField(blank=True, maxlength=20)

    employee_contract = models.ForeignKey('EmployeeContract')
    employee_assignment = models.ForeignKey('EmployeeAssignment')

AREA_LIST = (
    ('CKG', 'Cooking'),
    ('DLY', 'Delivery'),
    ('DYG', 'Drying'),
    ('FLA', 'Flavoring'),
    ('FYG', 'Frying'),
    ('LGS', 'Logistics'),
    ('MXG', 'Mixing'),
    ('PKG', 'Packaging'),
    ('ROG', 'Roasting'),

)
class EmployeeAssignment(models.Model):
    employee = models.ForeignKey(Employee)
    assignment_from = models.DateField()
    assignment_to = models.DateField()
    area = models.CharField(maxlength=3, choices=AREA_LIST)
    position = models.CharField(maxlength=20)
    edit_by = models.ForeignKey(Profile)

EMPLOYEE_CONTRACT_STATUS_LIST = (
    ('ACT', 'Active'),
    ('FIN', 'Finnish'),
    ('RES', 'Resign'),
    ('TER', 'Terminate'),
)
class EmployeeContract(models.Model):
    employee = models.ForeignKey(Employee)
    contract_to = models.DateField()
    contract_from = models.DateField()
    notes = models.CharField(blank=True, maxlength=200)
    status = models.CharField(maxlength=3,
choices=EMPLOYEE_CONTRACT_STATUS_LIST)
    edit_by = models.ForeignKey(Profile)

Although this problem can be solve with just renaming some of the
fields. I wonder if when doing some django orm operation could produce
a problem.

thanks
james


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