[prev in list] [next in list] [prev in thread] [next in thread]
List: zope
Subject: Re: [Zope] CatalogAwareBase doesn't auto-reindex?
From: Bryan Field-Elliot <bryan_lists () netmeme ! org>
Date: 2001-09-29 22:53:36
[Download RAW message or body]
OK Chris,
I understand what you're saying. But my follow-on question is, where
exactly can I find the code that is auto-generated from the properties
interface? And if there is no such code, then is there a complete code
sample, somewhere, of how I would code this myself? Your statement:
You need to create a custom properties-editing form with a target
that calls reindex_object as well as modifying the properties."
isn't really enough for a newbie like me to pick up and run with.
I'm also unclear where this prebuilt form is being built -- is it when I
define the property sheet, or instead is it when I create a view out of
a property sheet?
Having fun getting to know this system!
Bryan
On Sat, 2001-09-29 at 16:14, Chris McDonough wrote:
Hi Bryan,
Please keep the mail on the maillist, thanks.
This is a limitation when using prebuilt forms from the properties
interface. The prebuilt propertysheet editing forms don't call
reindex_object.
You need to create a custom properties-editing form with a target that
calls reindex_object as well as modifying the properties.
You could make the target a Python Script or a DTML method, as long as
it calls the right stuff (manage_changeProperties and reindex_object) on
itself with the right values.
HTH!
- C
Bryan Field-Elliot wrote:
> Thanks,
>
> Where do I place this call? There are no methods to modify, except the
> constructor. The constructor isn't the appropriate place, I think.
>
> Thanks,
>
> Bryan
>
> On Sat, 2001-09-29 at 16:04, Chris McDonough wrote:
>
> /I think you need to call "reindex_object" on your catalogaware object /
> /manually... it indexes itself automatically but doesnt reindex itself /
> /automatically./
> //
> /See http://www.zope.org/Members/AlexR/CatalogAware for more info.../
> //
> /Bryan Field-Elliot wrote:/
> /> Hi,/
> /> /
> /> I'm new to Zope -- let me first say, I'm totally blown away! I come from /
> /> a Java/JSP/Servlet world, and Zope is just blowing my mind!/
> /> /
> /> I am using the latest Zope release (downloaded and installed yesterday)./
> /> /
> /> I am trying to use ZCatalog, and CatalogAwareBase as a base class for my /
> /> custom ZObject./
> /> /
> /> I have successfully managed to get things straight so that my catalog /
> /> notices whenever I create new instances of my custom classess (I had to /
> /> call my catalog "Catalog"). The new instances correctly show up in the /
> /> "Catalog" tab of my Catalog./
> /> /
> /> However, I am having a terrible time trying to get the Catalog to /
> /> automatically re-index objects when I modify them. I am using standard /
> /> property sheet editor page generated in the Product config area for my /
> /> object class. Is this the wrong thing to do?/
> /> /
> /> It's hard to imagine the usefulness of the ZCatalog without it being /
> /> up-to-date when objects change. I guess I'm just used to the RDBMS world /
> /> where this is completely expected behavior./
> /> /
> /> I can't tell if this is a bug in CatalogAwareBase, or else if the /
> /> documentation is lacking./
> /> /
> /> Thanks,/
> /> /
> /> Bryan/
> /> /
> /> /
> //
> //
> /-- /
> /Chris McDonough Zope Corporation/
> /http://www.zope.org http://www.zope.com/
> /"Killing hundreds of birds with thousands of stones"/
> //
>
--
Chris McDonough Zope Corporation
http://www.zope.org http://www.zope.com
"Killing hundreds of birds with thousands of stones"
_______________________________________________
Zope maillist - Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope-dev )
[Attachment #3 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/0.13.99">
</HEAD>
<BODY>OK Chris,<br>
<br>
I understand what you're saying. But my follow-on question is, where exactly can I \
find the code that is auto-generated from the properties interface? And if there is \
no such code, then is there a complete code sample, somewhere, of how I would code \
this myself? Your statement:<br>
<blockquote>
<FONT SIZE="3"><I>You need to create a custom properties-editing form with a \
target that calls reindex_object as well as modifying the properties."</I></FONT \
SIZE="3"> </blockquote>
<FONT SIZE="3"></FONT SIZE="3"><br>
<FONT SIZE="3">isn't really enough for a newbie like me to pick up and run \
with.</FONT SIZE="3"><br> <br>
I'm also unclear where this prebuilt form is being built -- is it when I define the \
property sheet, or instead is it when I create a view out of a property sheet?<br> \
<br> Having fun getting to know this system!<br>
<br>
Bryan<br>
<br>
<br>
<br>
On Sat, 2001-09-29 at 16:14, Chris McDonough wrote:
<blockquote>
<pre><FONT COLOR="#737373"><FONT SIZE="3"><I>Hi Bryan,</FONT></I></FONT SIZE="3">
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></I></FONT SIZE="3">
<FONT COLOR="#737373"><FONT SIZE="3"><I>Please keep the mail on the maillist, \
thanks.</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT \
SIZE="3"><I></FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>This \
is a limitation when using prebuilt forms from the properties </FONT></I></FONT \
SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>interface. The prebuilt \
propertysheet editing forms don't call </FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>reindex_object.</FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I></FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>You need to create a custom properties-editing form \
with a target that </FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT \
SIZE="3"><I>calls reindex_object as well as modifying the \
properties.</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT \
SIZE="3"><I></FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>You \
could make the target a Python Script or a DTML method, as long as </FONT></I></FONT \
SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>it calls the right stuff \
(manage_changeProperties and reindex_object) on </FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>itself with the right values.</FONT></I></FONT \
SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></I></FONT SIZE="3">
<FONT COLOR="#737373"><FONT SIZE="3"><I>HTH!</FONT></I></FONT SIZE="3">
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></I></FONT SIZE="3">
<FONT COLOR="#737373"><FONT SIZE="3"><I>- C</FONT></I></FONT SIZE="3">
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></I></FONT SIZE="3">
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></I></FONT SIZE="3">
<FONT COLOR="#737373"><FONT SIZE="3"><I>Bryan Field-Elliot wrote:</FONT></I></FONT \
SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> Thanks,</FONT></I></FONT \
SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> </FONT></I></FONT SIZE="3">
<FONT COLOR="#737373"><FONT SIZE="3"><I>> Where do I place this call? There are no \
methods to modify, except the </FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT \
SIZE="3"><I>> constructor. The constructor isn't the appropriate place, I \
think.</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> \
</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> \
Thanks,</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> \
</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> \
Bryan</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> \
</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> On Sat, \
2001-09-29 at 16:04, Chris McDonough wrote:</FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>> </FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>> /I think you need to call \
"reindex_object" on your catalogaware object /</FONT></I></FONT SIZE="3"> \
<FONT COLOR="#737373"><FONT SIZE="3"><I>> /manually... it indexes itself \
automatically but doesnt reindex itself /</FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>> /automatically./</FONT></I></FONT SIZE="3"> \
<FONT COLOR="#737373"><FONT SIZE="3"><I>> //</FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>> /See \
http://www.zope.org/Members/AlexR/CatalogAware for more info.../</FONT></I></FONT \
SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> //</FONT></I></FONT SIZE="3">
<FONT COLOR="#737373"><FONT SIZE="3"><I>> /Bryan Field-Elliot \
wrote:/</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /> \
Hi,/</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /> \
/</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /> I'm \
new to Zope -- let me first say, I'm totally blown away! I come from \
/</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /> a \
Java/JSP/Servlet world, and Zope is just blowing my mind!/</FONT></I></FONT SIZE="3"> \
<FONT COLOR="#737373"><FONT SIZE="3"><I>> /> /</FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>> /> I am using the latest Zope release \
(downloaded and installed yesterday)./</FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>> /> /</FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>> /> I am trying to use ZCatalog, and \
CatalogAwareBase as a base class for my /</FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>> /> custom ZObject./</FONT></I></FONT \
SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /> /</FONT></I></FONT \
SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /> I have successfully \
managed to get things straight so that my catalog /</FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>> /> notices whenever I create new instances \
of my custom classess (I had to /</FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>> /> call my catalog "Catalog"). \
The new instances correctly show up in the /</FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>> /> "Catalog" tab of my \
Catalog./</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> \
/> /</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /> \
However, I am having a terrible time trying to get the Catalog to /</FONT></I></FONT \
SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /> automatically re-index \
objects when I modify them. I am using standard /</FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>> /> property sheet editor page generated in \
the Product config area for my /</FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>> /> object class. Is this the wrong thing to \
do?/</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /> \
/</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /> It's \
hard to imagine the usefulness of the ZCatalog without it being /</FONT></I></FONT \
SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /> up-to-date when objects \
change. I guess I'm just used to the RDBMS world /</FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>> /> where this is completely expected \
behavior./</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> \
/> /</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /> \
I can't tell if this is a bug in CatalogAwareBase, or else if the /</FONT></I></FONT \
SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /> documentation is \
lacking./</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> \
/> /</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /> \
Thanks,/</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> \
/> /</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /> \
Bryan/</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /> \
/</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /> \
/</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> \
//</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> \
//</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /-- \
/</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> /Chris \
McDonough Zope Corporation/</FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I>> /http://www.zope.org \
http://www.zope.com/</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT \
SIZE="3"><I>> /"Killing hundreds of birds with thousands of \
stones"/</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> \
//</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>> \
</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></I></FONT \
SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></I></FONT SIZE="3">
<FONT COLOR="#737373"><FONT SIZE="3"><I>-- </FONT></I></FONT SIZE="3">
<FONT COLOR="#737373"><FONT SIZE="3"><I>Chris McDonough Zope \
Corporation</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT \
SIZE="3"><I>http://www.zope.org http://www.zope.com</FONT></I></FONT \
SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>"Killing hundreds of birds \
with thousands of stones"</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT \
SIZE="3"><I></FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT \
SIZE="3"><I></FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT \
SIZE="3"><I>_______________________________________________</FONT></I></FONT \
SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>Zope maillist - \
Zope@zope.org</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT \
SIZE="3"><I>http://lists.zope.org/mailman/listinfo/zope</FONT></I></FONT SIZE="3"> \
<FONT COLOR="#737373"><FONT SIZE="3"><I>** No cross posts or HTML encoding! \
**</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I>(Related lists \
- </FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT SIZE="3"><I> \
http://lists.zope.org/mailman/listinfo/zope-announce</FONT></I></FONT SIZE="3"> <FONT \
COLOR="#737373"><FONT SIZE="3"><I> http://lists.zope.org/mailman/listinfo/zope-dev \
)</FONT></I></FONT SIZE="3"> <FONT COLOR="#737373"><FONT \
SIZE="3"><I></FONT></I></FONT SIZE="3"> </pre>
</blockquote>
</BODY>
</HTML>
_______________________________________________
Zope maillist - Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope-dev )
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic