Re: [Zope] Can't update properties of a custom product
At 10:23 AM 2/19/2003, Thierry FLORAC wrote:
I don't know how to enable this specific exception traceback...
I haven't moved to product development in 2.6 yet, maybe someone else can speak to this problem. One quick way to get the same info might be to create a standard_error_message in this folder that returns error_tb.
For the rest, my two forms are handled by different methods, effectively containing different fields. But what I really don't understand is why the standard "manage_editProperties" raise an exception, while I really use only common properties types. I'd prefer if it was my custom method which would raise en error...
The error you're getting is typically the result of attempting to perform a slice or index operation on an empty string or a string which is substantially shorter than some expected length. Looking at the code, I can't see any place in the standard manage_editProperties where string slicing/indexing takes place. My guess would be that it *is* one of your methods kicking up this error. Do you do any error handling in this product? If your except block is also kicking up an error, that could be interfering with Zope's standard error handling. I'm just thinking off the top of my head here... sounds like there's going to need to be some detective work on your side. FWIW, Dylan
On Wednesday 19 February 2003 21:41, Dylan Reinhardt wrote:
At 10:23 AM 2/19/2003, Thierry FLORAC wrote: The error you're getting is typically the result of attempting to perform a slice or index operation on an empty string or a string which is substantially shorter than some expected length. Looking at the code, I can't see any place in the standard manage_editProperties where string slicing/indexing takes place. My guess would be that it *is* one of your methods kicking up this error.
As I said in my previous message, my big problem is that I don't use any custom method in this case : it's the standard "manage_editProperties" method which is used !! So I suppose that it's my properties definition or contents which raise this exception, but I really can't see anything "special" in them... : _properties = IF_OrderedObjectManager.IF_OrderedObjectManager._properties + \ ( { 'id':'owner', 'type':'string', 'mode':'w' }, { 'id':'creator', 'type':'string', 'mode':'w' }, { 'id':'updater', 'type':'string', 'mode':'w' }, { 'id':'editor', 'type':'string', 'mode':'w' }, { 'id':'publisher', 'type':'string', 'mode':'w' }, { 'id':'creation_time', 'type':'date', 'mode':'' }, { 'id':'creation_date', 'type':'date', 'mode':'w' }, { 'id':'update_time', 'type':'date', 'mode':'w' }, { 'id':'edition_time', 'type':'date', 'mode':'w' }, { 'id':'publication_time', 'type':'date', 'mode':'w' }, { 'id':'first_pub_date', 'type':'date', 'mode':'w' }, { 'id':'last_pub_date', 'type':'date', 'mode':'w' }, { 'id':'description', 'type':'text', 'mode':'w' }, { 'id':'remarques', 'type':'text', 'mode':'w' }, { 'id':'keywords', 'type':'tokens', 'mode':'w' }, { 'id':'commentaire', 'type':'text', 'mode':'w' }, { 'id':'moral_author', 'type':'string', 'mode':'w' }, { 'id':'physical_author', 'type':'string', 'mode':'w' }, { 'id':'updaters', 'type':'selection', 'mode':'w', 'select_variable':'getUpdatersList' }, { 'id':'category', 'type':'selection', 'mode':'w', 'select_variable':'getCategories' }, { 'id':'status', 'type':'selection', 'mode':'w', 'select_variable':'getStatusList' }, { 'id':'private', 'type':'boolean', 'mode':'w' }, { 'id':'visible', 'type':'boolean', 'mode':'w' } ) IF_OrderedObjectManager is another class that I use as parent for other inherited subclasses, without any problem... I've also tried to add a "manage_editProperties(self, REQUEST)" method in my custom class, with just "return REQUEST" as content, but the exception is raised before the method is called, so I think that the problem is not at the class level, but probably at the Publisher level, when the HTTP request is handled... How can I try to debug this ??? Thierry
Hi, I finally found where my problem comes from ; I noticed that the exception response headers was containing references to the file which raised the exception : DateTime.py, line 655 !! After looking at the code and making a few more tests, I finally found that Zope don't accept 'None' or empty values for 'date' properties : you have to enter a valid date for date properties !! So my new question is simple : as en empty value is significant in several cases for this product, how can I handle empty date properties, without using string properties which will be converted as date in internal properties ?? Thanks, Thierry On Thursday 20 February 2003 10:22, Thierry FLORAC wrote:
On Wednesday 19 February 2003 21:41, Dylan Reinhardt wrote:
At 10:23 AM 2/19/2003, Thierry FLORAC wrote: The error you're getting is typically the result of attempting to perform a slice or index operation on an empty string or a string which is substantially shorter than some expected length. Looking at the code, I can't see any place in the standard manage_editProperties where string slicing/indexing takes place. My guess would be that it *is* one of your methods kicking up this error.
As I said in my previous message, my big problem is that I don't use any custom method in this case : it's the standard "manage_editProperties" method which is used !! So I suppose that it's my properties definition or contents which raise this exception, but I really can't see anything "special" in them... :
_properties = IF_OrderedObjectManager.IF_OrderedObjectManager._properties + \ ( { 'id':'owner', 'type':'string', 'mode':'w' }, { 'id':'creator', 'type':'string', 'mode':'w' }, { 'id':'updater', 'type':'string', 'mode':'w' }, { 'id':'editor', 'type':'string', 'mode':'w' }, { 'id':'publisher', 'type':'string', 'mode':'w' }, { 'id':'creation_time', 'type':'date', 'mode':'' }, { 'id':'creation_date', 'type':'date', 'mode':'w' }, { 'id':'update_time', 'type':'date', 'mode':'w' }, { 'id':'edition_time', 'type':'date', 'mode':'w' }, { 'id':'publication_time', 'type':'date', 'mode':'w' }, { 'id':'first_pub_date', 'type':'date', 'mode':'w' }, { 'id':'last_pub_date', 'type':'date', 'mode':'w' }, { 'id':'description', 'type':'text', 'mode':'w' }, { 'id':'remarques', 'type':'text', 'mode':'w' }, { 'id':'keywords', 'type':'tokens', 'mode':'w' }, { 'id':'commentaire', 'type':'text', 'mode':'w' }, { 'id':'moral_author', 'type':'string', 'mode':'w' }, { 'id':'physical_author', 'type':'string', 'mode':'w' }, { 'id':'updaters', 'type':'selection', 'mode':'w', 'select_variable':'getUpdatersList' }, { 'id':'category', 'type':'selection', 'mode':'w', 'select_variable':'getCategories' }, { 'id':'status', 'type':'selection', 'mode':'w', 'select_variable':'getStatusList' }, { 'id':'private', 'type':'boolean', 'mode':'w' }, { 'id':'visible', 'type':'boolean', 'mode':'w' } )
IF_OrderedObjectManager is another class that I use as parent for other inherited subclasses, without any problem...
I've also tried to add a "manage_editProperties(self, REQUEST)" method in my custom class, with just "return REQUEST" as content, but the exception is raised before the method is called, so I think that the problem is not at the class level, but probably at the Publisher level, when the HTTP request is handled... How can I try to debug this ???
Thierry
_______________________________________________ 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 )
-- Linux every day, keeps Dr Watson away... http://gpc.sourceforge.net -- http://www.ulthar.net
participants (2)
-
Dylan Reinhardt -
Thierry FLORAC