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
--On 24. Juni 2007 15:08:22 +0100 kamal hamzat <hamzat@dnetsystems.net> wrote:
Hi,
I need a python script or function to get the total number of records in a zcatalog.
len(catalog). -aj
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" <lists@zopyx.com> To: "kamal hamzat" <hamzat@dnetsystems.net>; <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
--On 15. Oktober 2007 13:45:37 +0100 kamal hamzat <hamzat@dnetsystems.net> 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
participants (2)
-
Andreas Jung -
kamal hamzat