[Zope-dev] Repost to zope-dev: Best way to do links

2001-11-13 Thread Oliver Bleutgen

Hi reposting to zope-dev because the zope-list didn't yield
any answer (although it should belong there, I think).

I am unsure how to achieve the following in a product:

I have a folder with templates which shall be used to render articles.
This folder will be the central repository of templates for all articles 
which find it in their acquisition path.
Now, I want be able to dynamically assign (and change) templates for a
given article, and if I edit one template it should reflect in all
articles which are configured to use that template.

In http://lists.zope.org/pipermail/zope-dev/2001-May/011187.html Shane
Hathaway  describe hardlinks, which seem to do what I need.

i.e. I then just do
t = template_folder.one_template
self.template = t

I looked at how ZSQL-methods solve that problem (usage of
SQLConnections), and as far as I can see ZSQL-methods just store the id
of the ZSQL connection and use that everytime they need to access the DB.

Is that right and if so, why is it done that way?
Doesn't give that a performance hit?

And the last one:

Will the above described method still allow import/export of these 
instances?

cheers,
oliver





___
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] Catalog Text Indexing

2001-11-13 Thread Terry Kerr

Hi,

Is there any particular reason that a Text Index will index an object by
acquiring the value to index?  Shouldn't it not index at all if the
value doesn't exist on the object?

The only way I can get my objects to not be indexed if they don't have
the indexing attribute is to set the attribute to None, reindex, then
remove the attribute.  By make this simple change to
lib/python/Products/PluginIndexes/TextIndex/TextIndex.py


353c353,354
 source = getattr(obj, self.id)
---
 from Acquisition import aq_base
 source = getattr(aq_base(obj), self.id)

The object is only indexed if the value exists on that object.  This
fixes my problem.

I believe KeyWord Indexes have the same problem

Terry




-- 
Terry Kerr ([EMAIL PROTECTED])
Chief Technical Officer
Bizar Software Pty Ltd (www.bizarsoftware.com.au)
Phone: +61 3 9563 4461
Fax: +61 3 9563 3856
ICQ: 79303381

___
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 )