Maybe try: if tday==i.id: If you are trying to access the id from the metadata. It might be clearer with a more descriptive iterator variable, such as "doc" or something. hth, -Casey On Tuesday 20 August 2002 01:07 pm, Sir K wrote:
I have a Zcatalogue that store id of Dtml docs as part of the meta_data, then i want to iterate over it and see if at least there will be one id that equal to tday and return the value assigned to tday or else to store the value of yday to tday and return it as tday.
Then my major problem is how to access the id from the Zcat_New1_Dtml_doc;
The code below is giving me Error Type: NameError Error Value: global name 'id' is not defined
tday=DateTime().toZone('GMT+1').strftime('%d%m%y') yday=(DateTime()-1).toZone('GMT+1').strftime('%d%m%y') for i in context.Zcat_New1_Dtml_doc(): if tday==id: return tday else: tday=yday return tday