[Zope] python script error: pls help

Sir K k_hamzat@yahoo.com
Wed, 21 Aug 2002 06:52:29 -0700 (PDT)


> > 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():
>         # Should be correct (untested)
>         id = i.getObject().getId()
> >      if tday==id:
> >          return tday
> >      else:
> >          tday=yday
> >          return tday

I tried it but no result. When it is obvious that tday=id, it refuses to
return tday but follow the else part.

Then I later tried without else part;

tday=DateTime().toZone('GMT+1').strftime('%d%m%y')
for i in context.Zcat_New1_Dtml_doc():
      id = i.getObject().getId()
      if tday==id:
         return tday

This is the error:

Error Type: AttributeError
Error Value: 'None' object has no attribute 'getId'

Thanks.




=====
Hamzat kamaldeen Ishola Dnet Systems Limited. 223 Ikorodu Road, Lagos. Nigeria. 234 1 7749381, 234 08033011305 --- If Mistake is an opportunity to see better, then it is not a problem but readiness to admit it. Sentimental decisions are not mistakes but failures !!! 

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com