Re: [Zope-dev] How to get Entrys from a catalog by date boundaries

2002-07-24 Thread Lennart Regebro

From: Sebastian Sippl [EMAIL PROTECTED]
 When I send my request, the only things I get back are some MYBRAnI
 instance at #123848-tags.

Thats what you get back from catalog queries. Each brain is a small object
that has all the meta-data you have indexed in the catalog as properties.
It's done like this to enable queries to be lazy. You don't actually need
to read in the data until it's accessed, which is a great performance boost.

You use the brain as if it were a dictionary, and the result is a list of
brains. So you go

for brain in result:
if brain['id'] == 'foo':
context.barf()

or something of that ilk.




___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] How to get Entrys from a catalog by date boundaries

2002-07-23 Thread Sebastian Sippl

Hi,

I've tried to select all entrys from a catalog by defining the date 
boundaries(Python script).
Looks like this:

id=context.getId()

return context.cata(
 {'content' : id,
  'date': [datestart, dateend],
  'date_usage' : 'range:min:max',
 }
)
cata = my catalog,datestart =start date(date-string),dateend=end date

When I send my request, the only things I get back are some MYBRAnI 
instance at #123848-tags.

For the beginning i would just like to get the ids of the items in the 
boundaries.

How can i achieve that?
Please help !!

Sebastian








___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] How to get Entrys from a catalog by date boundaries

2002-07-23 Thread Toby Dickenson

On Tuesday 23 Jul 2002 10:20 am, Sebastian Sippl wrote:
 Hi,

 I've tried to select all entrys from a catalog by defining the date
 boundaries(Python script).
 Looks like this:

 id=context.getId()

 return context.cata(
  {'content' : id,
   'date': [datestart, dateend],
   'date_usage' : 'range:min:max',
  }
 )
 cata = my catalog,datestart =start date(date-string),dateend=end date

 When I send my request, the only things I get back are some MYBRAnI
 instance at #123848-tags.

 For the beginning i would just like to get the ids of the items in the
 boundaries.

If you have id set up as catalog metadata, then those objects will each have 
an id attribute which does what you want.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )