Re: [Zope] python function to know the total number of records in a catalog object
Hi, I am getting NameError: global name 'zCatArticlesCurrent' is not defined on this code whereas I have the zCatArticlesCurrent object in the same container with the script. a = len(zCatArticlesCurrent) print a return printed Traceback (innermost last): a.. Module ZPublisher.Publish, line 119, in publish b.. Module ZPublisher.mapply, line 88, in mapply c.. Module ZPublisher.Publish, line 42, in call_object d.. Module Shared.DC.Scripts.Bindings, line 313, in __call__ e.. Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec f.. Module Products.PythonScripts.PythonScript, line 327, in _exec g.. Module None, line 1, in sizeZcat PythonScript at /nation/news/sizeZcat Line 1 NameError: global name 'zCatArticlesCurrent' is not defined - Original Message - From: Andreas Jung [EMAIL PROTECTED] To: kamal hamzat [EMAIL PROTECTED]; zope@zope.org Sent: Sunday, June 24, 2007 3:21 PM Subject: Re: [Zope] python function to know the total number of records in a catalog object ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] python function to know the total number of records in a catalog object
--On 15. Oktober 2007 13:45:37 +0100 kamal hamzat [EMAIL PROTECTED] wrote: Hi, I am getting NameError: global name 'zCatArticlesCurrent' is not defined on this code whereas I have the zCatArticlesCurrent object in the same container with the script. a = len(zCatArticlesCurrent) print a return printed Please learn about Acquisiton - one of the core concepts of Zope. Likely you want 'context.zCatArticlesCurrent' or something similar. http://www.plope.com/Books/2_7Edition -aj pgpy2x3okyc9A.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] python function to know the total number of records in a catalog object
Hi, I need a python script or function to get the total number of records in a zcatalog. Thanks Kamal___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] python function to know the total number of records in a catalog object
--On 24. Juni 2007 15:08:22 +0100 kamal hamzat [EMAIL PROTECTED] wrote: Hi, I need a python script or function to get the total number of records in a zcatalog. len(catalog). -aj pgp0NXchjuLox.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )