Re: [sqlalchemy] Tea Rota

2012-01-13 Thread Ian Kelly
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    

Re: [sqlalchemy] Tea Rota

2012-01-13 Thread Calum MacLeod
Thanks, Ian, I appreciate your advice and have removed the first conditional (if name not in duties). Have now changed that to: duty = Duty(date=date) duties[date] = duty if name not in volunteers: volunteer = Volunteer(fore=fore, surn=surn, name=name)

Re: [sqlalchemy] Tea Rota

2012-01-13 Thread werner
Hi Calum, On 01/13/2012 01:31 PM, Calum MacLeod wrote: Thanks, Ian, I appreciate your advice and have removed the first conditional (if name not in duties). Have now changed that to: duty = Duty(date=date) duties[date] = duty if name not in volunteers: volunteer =

Re: [sqlalchemy] Tea Rota

2012-01-13 Thread Calum MacLeod
Dear Werner, Thanks for completing the puzzle for me! I followed your code precisely and it worked as you would have expected. So now I have the @hybrid property in my class definition too. (The reason that I ended up previously with fore,surn and name was that I was not sure of how the line

[sqlalchemy] Tea Rota

2012-01-12 Thread Calum MacLeod
I am relatively new both to python and to sqlalchemy. I am a hobbiest, trying to learn this for fun. Have been using a Sunday tea rota as a simple project by which to learn the rudiments of sqla. The rota consists of 16 people and the number of days on which tea is offered amounts to 47.