Re: [Zope-dev] ZODB Mountpoint broken?

2012-02-29 Thread Suresh V.

On Wednesday 29 February 2012 07:31 PM, Tres Seaver wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02/28/2012 09:56 PM, Suresh V. wrote:

ZODB Mountpoint distributed with Plone 4.1.2 always seems to create
OFS.Folder even if the container-class is specified.

Also getting a KeyError: item already present wih same id due to
_setObject and _setOb both being called.



Can you post the full traceback for that error?



In Products.ZODBMountPoint.MountedObject.py around line 373:

# Add a faux object to avoid generating manage_afterAdd() events
# while appeasing OFS.ObjectManager._setObject(), then discreetly
# replace the faux object with a MountedObject.
faux = Folder()
faux.id = mo.id
faux.meta_type = loaded.meta_type
container._setObject(faux.id, faux)
# DM 2005-05-17: we want to keep our decision about automatic
#  mount point creation
#del mo._create_mount_points
container._setOb(faux.id, mo)
setMountPoint(container, faux.id, mo)

The error was raised on the _setOb() line.

Removing the whole faux dance made everything work correctly. May be 
this is not necessary any more. Should I create a ticket?







Am trying to mount a plone.app.folder.folder.ATFolder from a separate
  Data.fs using instructions in:

http://plone.org/documentation/kb/mount-zeo-into-plonesite



Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9OL8AACgkQ+gerLs4ltQ6KXgCfUSmkU98w0QP3++tzXnmqdClr
0eMAn0XmTpASam2I2zD80b+IF9ONhoTk
=hNK7
-END PGP SIGNATURE-

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
  https://mail.zope.org/mailman/listinfo/zope-announce
  https://mail.zope.org/mailman/listinfo/zope )




___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Mountpoint broken?

2012-02-29 Thread Suresh V.

On Wednesday 29 February 2012 07:31 PM, Tres Seaver wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02/28/2012 09:56 PM, Suresh V. wrote:

ZODB Mountpoint distributed with Plone 4.1.2 always seems to create
OFS.Folder even if the container-class is specified.

Also getting a KeyError: item already present wih same id due to
_setObject and _setOb both being called.



Can you post the full traceback for that error?


2012-03-01 09:40:22 ERROR Zope.SiteErrorLog 1330575022.340.697799684491 
http://localhost:8080/Plone/AllContent/manage_addProduct/ZODBMountPoint/manage_addMounts

Traceback (innermost last):
  Module ZPublisher.Publish, line 126, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 46, in call_object
  Module Products.ZODBMountPoint.MountedObject, line 387, in 
manage_addMounts

  Module plone.folder.ordered, line 63, in _setOb
  Module Products.BTreeFolder2.BTreeFolder2, line 244, in _setOb
KeyError: 'There is already an item named plant.'





___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] ZODB Mountpoint broken?

2012-02-28 Thread Suresh V.
ZODB Mountpoint distributed with Plone 4.1.2 always seems to create 
OFS.Folder even if the container-class is specified.


Also getting a KeyError: item already present wih same id due to 
_setObject and _setOb both being called.


Am trying to mount a plone.app.folder.folder.ATFolder from a separate 
Data.fs using instructions in:


http://plone.org/documentation/kb/mount-zeo-into-plonesite

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


[Zope-CMF] GenericSetup: Question on StackOverflow

2011-04-09 Thread Suresh V.
Please see:

http://stackoverflow.com/questions/5603459/genericsetup-what-does-toolset-xml-accomplish-if-toolinit-still-has-to-be-called

I could not create a cmf tag, so if you can please add that to the 
tags in the question.

Thank you for your answer.

Suresh

___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


[Zope-CMF] Versions found on pypi but not in svn tags

2011-04-02 Thread Suresh V.
How come the following versions are not found in svn tags?

Products.CMFCore: Versions 2.2.1, 2.2.2, 2.2.3

How do I access previous version tarballs on pypi?

Thanks.

Suresh

___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


[Zope-CMF] [GenericSetup] Enable export of ATFile content using portal_setup

2011-02-21 Thread Suresh V.
In order to enable ATFile objects to be exported using portal_setup, I 
have filed a bug and included a patch at:

https://bugs.launchpad.net/zope-cmf/+bug/722726

Can someone review and merge please?

Thanks.

Suresh



___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


[Zope-CMF] How do you add an action in python code?

2010-06-18 Thread Suresh V.
I have been looking at the Action* related code and have not been able 
to figure it out completely.

I tried portal_actions.addAction(...) but this adds it under the 
Actions tab with the big RED deprecation warning.

I am able to add it from the ZMI correctly, but can't trace the code 
that does the real adding (Ended up getting lost in GenericSetup browser 
views).

Can someone give me a pointer?

Suresh

___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


[Zope-dev] Multiple file upload in a single form

2008-05-13 Thread Suresh V.
Has anyone come across a Multiple File field type that be used in a form 
, specifically with z3c.form? This will enable an unlimited number of 
files to be uploaded in a single form.


I know this exists in the Plone world. Just wanted to check for an 
analogous field for a zope3 application.


If there isn't one there already, we would like to implement one.
Any pointers welcome.

Thanks.

Suresh

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope] Re: Strange property behaviour - why? (zope 2.10/Five)

2008-05-13 Thread Suresh V.

Piotr Chamera wrote:



def list_items2(self):
 test 
return self.items


try to remove acquisition wrapper before you access items?

Suresh

___
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-dev] How do you redirect and set request variables without showing up in query string?

2008-02-10 Thread Suresh V.

Is this possible?

I have tried a technique with a form that submits on load but this is 
somewhat slow.


Suresh

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope] Re: Counting threads

2008-01-22 Thread Suresh V.

Peter Bengtsson wrote:
Perhaps I'm wrong but I suspect that a Zope I'm running is dying because 
of running out of threads. They probably die when being designated to 
open an external relational database connection or something dodgy.


What are my options for monitoring and debugging what zope's threads are 
doing?
Is there a simple tool to just get a simple readout of how many threads 
are busy?




May be you can try by using just 1 thread and then debug it to see how 
it dies.


Suresh

___
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] Re: compile time optimizations for python

2008-01-19 Thread Suresh V.

Tres Seaver wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1




 - Tune the ZEO disk cache size (the warning sign is seen lots of
   ZEO cache flip entries in the event log).



Can you explain this some more?

1. Do we increase the cache size when we see these ZEO cache flips?
2. What is a good rate for these cache flips?

Suresh

___
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] Re: getting this trying to add a plone site to zope 2.9.4...

2007-04-17 Thread Suresh V

Did you get this problem resolved? I am facing the same.

Suresh

michael nt milne wrote:

Traceback (innermost last):
  Module ZPublisher.Publish, line 115, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 41, in call_object
  Module Products.CMFPlone.factory
, line 52, in addPloneSite
  Module Products.GenericSetup.tool, line 251, in runAllImportSteps
   - __traceback_info__: profile-CMFPlone:plone
  Module Products.GenericSetup.tool, line 725, in _doRunImportStep

   - __traceback_info__: plone-final
  Module Products.CMFPlone.setuphandlers, line 212, in importFinalSteps
  Module Products.CMFPlone.setuphandlers, line 109, in setupPortalContent
  Module Products.CMFPlone.utils
, line 369, in _createObjectByType
  Module Products.CMFCore.TypesTool, line 357, in _finishConstruction
  Module Products.CMFCore.CMFCatalogAware, line 145, in notifyWorkflowCreated
  Module Products.CMFCore.WorkflowTool
, line 354, in notifyCreated
  Module Products.CMFCore.WorkflowTool, line 699, in _reindexWorkflowVariables
  Module Products.Archetypes.CatalogMultiplex, line 66, in reindexObjectSecurity
  Module Products.ZCatalog.CatalogBrains
, line 52, in _unrestrictedGetObject
  Module OFS.Traversable, line 187, in unrestrictedTraverse
   - __traceback_info__: ([], 'previous')
  Module Products.Five.traversable, line 115, in __bobo_traverse__

AttributeError: previous



--
michael




___
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 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] Re: getting this trying to add a plone site to zope 2.9.4...

2007-04-17 Thread Suresh V

Suresh V wrote:

Did you get this problem resolved? I am facing the same.


I upgraded to Zope 2.9.6 and this went away.

Suresh



michael nt milne wrote:

Traceback (innermost last):
  Module ZPublisher.Publish, line 115, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 41, in call_object
  Module Products.CMFPlone.factory
, line 52, in addPloneSite
  Module Products.GenericSetup.tool, line 251, in runAllImportSteps
   - __traceback_info__: profile-CMFPlone:plone
  Module Products.GenericSetup.tool, line 725, in _doRunImportStep

   - __traceback_info__: plone-final
  Module Products.CMFPlone.setuphandlers, line 212, in importFinalSteps
  Module Products.CMFPlone.setuphandlers, line 109, in setupPortalContent
  Module Products.CMFPlone.utils
, line 369, in _createObjectByType
  Module Products.CMFCore.TypesTool, line 357, in _finishConstruction
  Module Products.CMFCore.CMFCatalogAware, line 145, in 
notifyWorkflowCreated

  Module Products.CMFCore.WorkflowTool
, line 354, in notifyCreated
  Module Products.CMFCore.WorkflowTool, line 699, in 
_reindexWorkflowVariables
  Module Products.Archetypes.CatalogMultiplex, line 66, in 
reindexObjectSecurity

  Module Products.ZCatalog.CatalogBrains
, line 52, in _unrestrictedGetObject
  Module OFS.Traversable, line 187, in unrestrictedTraverse
   - __traceback_info__: ([], 'previous')
  Module Products.Five.traversable, line 115, in __bobo_traverse__

AttributeError: previous



--
michael




___
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 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 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] Re: ImportError: cannot import name base_hasattr

2007-03-04 Thread Suresh V

[EMAIL PROTECTED] wrote:

Hi:
This really should go to the Plone list, but seeing as how I can't hit 
their site from either of my browsers, how can I subscribe to the list? 
I couldn't download Plone, either, so I just built it from tarballs from 
an earlier installation, tarballing all the products associated with it 
(Plone 2.1.4, I think). Then I loaded them up in Zope 2.7.8 and got this 
error:
 
Traceback (most recent call last):
  File /usr/local/www/zope/278/lib/python/OFS/Application.py, line 
673, in import_product
  File /usr/local/zope/instance1/Products/ATContentTypes/__init__.py, 
line 54, in ?

import Products.ATContentTypes.content
  File 
/usr/local/zope/instance1/Products/ATContentTypes/content/__init__.py, 
line 34, in ?

import Products.ATContentTypes.content.topic
  File 
/usr/local/zope/instance1/Products/ATContentTypes/content/topic.py, 
line 33, in ?

from Products.CMFPlone.CatalogTool import CatalogTool
  File /usr/local/zope/instance1/Products/CMFPlone/CatalogTool.py, 
line 27, in ?

from Products.CMFPlone.utils import base_hasattr
ImportError: cannot import name base_hasattr
Traceback (most recent call last):
  File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 50, in ?
run()
  File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 19, in run
start_zope(opts.configroot)
  File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 
52, in start_zope

starter.startZope()
  File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 
231, in startZope

Zope.startup()
  File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 
47, in startup

# drop privileges after setting up servers
  File /usr/local/www/zope/278/lib/python/Zope/App/startup.py, line 
45, in startup
  File /usr/local/www/zope/278/lib/python/OFS/Application.py, line 
650, in import_products
  File /usr/local/www/zope/278/lib/python/OFS/Application.py, line 
673, in import_product
  File /usr/local/zope/instance1/Products/ATContentTypes/__init__.py, 
line 54, in ?

import Products.ATContentTypes.content
  File 
/usr/local/zope/instance1/Products/ATContentTypes/content/__init__.py, 
line 34, in ?

import Products.ATContentTypes.content.topic
  File 
/usr/local/zope/instance1/Products/ATContentTypes/content/topic.py, 
line 33, in ?

from Products.CMFPlone.CatalogTool import CatalogTool
  File /usr/local/zope/instance1/Products/CMFPlone/CatalogTool.py, 
line 27, in ?

from Products.CMFPlone.utils import base_hasattr
ImportError: cannot import name base_hasattr


I am getting the same problem with Zope 2.8.8 installed with the Windows 
Installer and Plone 2.1.4 for all platforms.


I removed all the pyc files and the problem persists.

This is on Win 2K.

Suresh

___
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] Re: Zope hangs and Python eats all memory

2007-01-17 Thread Suresh V

Nico Grubert wrote:

Dear list members,

I am running Zope 2.9.6. on a 64-Bit Suse Linux 10.1 machine (9 Gbyte of 
RAM) with Python 2.4.3. installed.
 From time to time, Zope hangs and I cannot access it anymore. I tried 
to use the Zope DeadlockDebugger but if my Zope hangs I cannot call 
the URL http://myzopesite:8080/manage_debug_threads?secret_password; to 
let Zope DeadlockDebugger show any useful information. Zope does not 
response.
If Zope hangs, the python process eats all the memory and the machine 
starts to swap.


The top command in the shell tells me: 
-

Tasks:  91 total,   2 running,  89 sleeping,   0 stopped,   0 zombie
Cpu(s): 10.4%us,  0.4%sy,  0.0%ni, 89.0%id,  0.2%wa,  0.0%hi,  0.0%si
Mem:   9041256k total,  9025124k used,16132k free,10604k buffers
Swap:  4208988k total,  4208988k used,0k free, 9472k cached

  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND
29992 wwwrun16   0 12.0g 8.3g 2860 S   19 95.9   3:52.66 python
-

There are several add-ons for Zope installed, like:
 - Psycopg Postgres Database Adapter
 - mxODBCDA ODBC Database Adapter
 - LDAPUserfolder
 - Silva Content Management System
 - PIL

Furthermore, I see a lot of Conflict Errors in the event.log like e.g.:
-
ZPublisher.Conflict ConflictError at 
/VirtualHostBase/http/193.134.202.20:80/mysite/VirtualHostRoot/: 
database conflict error (oid 0x0435, class BTrees._OOBTree.OOBTree, 
serial this txn started with 0x036aeb14ab1c4b88 2007-01-15 
12:04:40.104030, serial currently committed 0x036aeb1d0cc5d099 
2007-01-15 12:13:02.993605) (80 conflicts (0 unresolved) since startup 
at Mon Jan 15 11:44:55 2007)

-

These kind of Conflict errors occur almost every minute.
It might be that these errors have something to do with it but I am not 
sure.


How can I figure out what exactly causes Zope to hang?
If you need more information, please let me know.


Have you tried to enable the trace logger in the zope.conf file?
Look for the stanza beginning with logger trace.

You need to have your server in debug-mode. This will produce a
trace.log file that can be analyzed with requestprofiler.py.

This will give you the offending requests that caused Zope to hang.

Suresh


___
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] Re: Zope hangs and Python eats all memory

2007-01-15 Thread Suresh V

Nico Grubert wrote:

Dear list members,

I am running Zope 2.9.6. on a 64-Bit Suse Linux 10.1 machine (9 Gbyte of 
RAM) with Python 2.4.3. installed.
 From time to time, Zope hangs and I cannot access it anymore. I tried 
to use the Zope DeadlockDebugger but if my Zope hangs I cannot call 
the URL http://myzopesite:8080/manage_debug_threads?secret_password; to 
let Zope DeadlockDebugger show any useful information. Zope does not 
response.
If Zope hangs, the python process eats all the memory and the machine 
starts to swap.


The top command in the shell tells me: 
-

Tasks:  91 total,   2 running,  89 sleeping,   0 stopped,   0 zombie
Cpu(s): 10.4%us,  0.4%sy,  0.0%ni, 89.0%id,  0.2%wa,  0.0%hi,  0.0%si
Mem:   9041256k total,  9025124k used,16132k free,10604k buffers
Swap:  4208988k total,  4208988k used,0k free, 9472k cached


Your swap appears low. Try increasing it to 20GB.

Suresh


___
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] Too many ZODB object loads...

2006-12-21 Thread Suresh V

On the database Activity tab in the Control Panel, I am seeing a high
number of Object Loads (400K per hour). My cache size if 60K from what I 
see in the Cache Parameters tab, each of the 4 threads is well within 
this limit. My database has about 1M objects.


The symptom is that Zope appears slow when adding/editing content.

Any idea if this is a problem?

Suresh

___
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] Re: Too many ZODB object loads...

2006-12-21 Thread Suresh V

Dieter Maurer wrote:

Suresh V wrote at 2006-12-21 22:09 +0530:

On the database Activity tab in the Control Panel, I am seeing a high
number of Object Loads (400K per hour). My cache size if 60K from what I 
see in the Cache Parameters tab, each of the 4 threads is well within 
this limit.


60 k is unusually large. Are you sure that this is not the
combined size of all caches (such that each cache has a capacity
of 15 k)?


We hiked it up to 60K per thread because we have lots of memory and 
wanted to make Zope perform better. Is there a disadvantage to this?




When the ZODB reported that it has read some number of objects,
it is very likely that it did indeed.


But even under very little site activity, it seems to be loading a lots 
of objects. Is this normal?





...
The symptom is that Zope appears slow when adding/editing content.


Do you use text indexing? with ranking information?

The usual cosine (OKAPI) ranking requires a large amount of data.



Nope.


When you perform modifications, usually the problem is not
the amount of objects read but the amount and size of
objects written. Use fsdump to determine the size of your
transactions.



I will check this.

Thanks for your pointers.

Suresh

___
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] Re: Preserving Context

2006-12-12 Thread Suresh V

Javier Subervi wrote:



div align=center tal:condition=here/hasSearchEngine(mycontext)


And where is mycontext defined? You will need a tal:define=mycontext 
here or something.




I tested the following script with mycontext as a passed parameter:

return 0

catalog = ''
try:
catalog = getattr(mycontext, mycontext.superValues('ZCatalog')[0].id)
except:
pass
   


Bare except? You bad boy!

Use except AttributeError:

In fact remove the try/except and study the trace output.

Suresh

___
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] Re: Preserving Context

2006-12-11 Thread Suresh V

Javier Subervi wrote:

Hi;
I have a page template which I use to catch and customize 404 errors. In 
that page, I call a script that offers site navigation. Since I have 
several sites within a portal, I decided to move all common elements 
(such as this page) to a central root location from which all sites 
could draw. However, when I did that, this page returned the navigation 
of that root dir! That's not what I want, of course. How do I preserve 
context for the called script, such that when the page is called, it 
passes the context from where it was called to the script in question?

TIA,
Javier



1. Are you using container rather than context in your script?
2. You can pass your context as a mycontext parameter to your script.

Suresh


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