On Thu, Jan 12, 2012 at 3:14 PM, Calum MacLeod <pan...@sky.com> wrote: > if date not in duties: > duty = Duty(date=date) > duties[date] = duty > > if name not in volunteers: > volunteer = Volunteer(fore=fore, surn=surn, name=name) > volunteers[name] = volunteer > volunteer.duties.append(duty)
If the date or the volunteer are already in the respective dicts, you never assign the 'duty' or 'volunteer' variable. Thus it would retain its value from the last iteration. This is probably why you seem to be missing volunteers -- some of your dict entries are getting clobbered with the wrong volunteers. Cheers, Ian -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.