Re: [Tutor] iteration is overwriting the previous set value

2005-10-20 Thread bob
At 12:32 AM 10/20/2005, Jonas Melian wrote: >bob wrote: > > > At 04:16 PM 10/19/2005, Jonas Melian wrote: > > > >> def _pre_save(self): > >> for field in [self.name, self.native_name]: > >> if not field.istitle(): > >> #print field.title() > >> field = field.titl

Re: [Tutor] iteration is overwriting the previous set value

2005-10-20 Thread Jonas Melian
Your code is correct. Thanks I understood it. 'field' is a local variable inner that loop. Respect to a related matter, a should be '42' Danny Yoo wrote: >On Thu, 20 Oct 2005, Jonas Melian wrote: > > > >Hi Jonas, > > >Do you understand why it isn't working? > >The issue is that 'field' is just

Re: [Tutor] iteration is overwriting the previous set value

2005-10-20 Thread Jonas Melian
bob wrote: > At 04:16 PM 10/19/2005, Jonas Melian wrote: > >> def _pre_save(self): >> for field in [self.name, self.native_name]: >> if not field.istitle(): >> #print field.title() >> field = field.title() >> >> The change I try to do there (field = field.title(

Re: [Tutor] iteration is overwriting the previous set value

2005-10-19 Thread bob
At 04:16 PM 10/19/2005, Jonas Melian wrote: >def _pre_save(self): > for field in [self.name, self.native_name]: > if not field.istitle(): > #print field.title() > field = field.title() And FWIW there is no benefit in using "if not field.istitle():" since it cal

Re: [Tutor] iteration is overwriting the previous set value

2005-10-19 Thread bob
At 04:16 PM 10/19/2005, Jonas Melian wrote: >def _pre_save(self): > for field in [self.name, self.native_name]: > if not field.istitle(): > #print field.title() > field = field.title() > >The change I try to do there (field = field.title()) is not being applied

Re: [Tutor] iteration is overwriting the previous set value

2005-10-19 Thread Danny Yoo
On Thu, 20 Oct 2005, Jonas Melian wrote: > def _pre_save(self): > for field in [self.name, self.native_name]: > if not field.istitle(): > #print field.title() > field = field.title() > > The change I try to do there (field = field.title()) is not being > applie

[Tutor] iteration is overwriting the previous set value

2005-10-19 Thread Jonas Melian
def _pre_save(self): for field in [self.name, self.native_name]: if not field.istitle(): #print field.title() field = field.title() The change I try to do there (field = field.title()) is not being applied I changed code so that you do 'self.foo = bar' statement