I would create an employee_history table Then have an employee_id, date_change, old_dept, new_dept.
Or if you wanted to track multiple types of changes...just have employee_id, date_change, change description, something like that. On Mar 13, 7:07 pm, "DuncanM" <[EMAIL PROTECTED]> wrote: > I'm not sure exactly how you could do this, > but for an employee to change department, you will edit it. This edit > is saved in django's admin log (or whatever its called) so maybe you > look at something similar to that where it only saves the changes for > an employee where the department id has changed? > > Sorry I can't give any more specific examples, I'm too new to django/ > python for that. > > Duncan > > On Mar 14, 12:01 am, "Gustav" <[EMAIL PROTECTED]> wrote: > > > Hi guys! > > > Sorry for the newbie question here, but I've looked around and > > couldn't find the answer... So, here's the problem: say I've got two > > models and a database that look like this: > > > EMPLOYEE DEPARTMENT > > ========== ============ > > employee_id dpt_id > > first_name dpt_name > > last_name > > department_id > > > So, the employee table references the department table many-to-one. > > Thus, say an employee changes deparment and I want to keep track > > historically of all the changes, how would I design it? I've tried > > creating a many-to-many table , but it didn't work. Again, sorry if > > it's too basic and I realize that this is more of db design experience > > than a django per se, but I'm stuck.... > > > Thanks and best, > > > Gustav --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---