RE: [Zope-dev] ZPatterns: getItem returns None

2001-03-20 Thread Roch'e Compaan

 Seems like the first element of the list of result objects returned by
 sqlGetAllotmentArea doesn't define anything called 'AllotmentArea_ID'.
 Could it be a case problem? What datbase/db_adaptor are you using?

It is a case problem, which really surprised me because Interbase is not
case sensitive.  I feel a bit stupid for not having considered this as a
possible problem but for anybody using the Gvib Interbase DA, note that
column names are capatilized in results.

Dammit stupidity can waste a lot of time.

Thanks for pointing out the obvious.

Roch


___
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] ZPatterns: getItem returns None

2001-03-19 Thread Roch'e Compaan


 In my experience, getItem will return None if *anything* goes wrong
 with data retieval or object creation.  Sometimes you get a traceback in
 the STUPID_LOG, and sometimes you don't (and I haven't figured out the
 pattern yet).  Test everything you can independently, and simplify
 everything to the bare minimum until you get it to work, and then
 add back the other variables, etc.

In all simplicity I still can't get it to work but here's some more info
from the console:

Traceback (innermost last):
  File
C:\PROGRA~1\ZOPE230\lib\python\Products\ZPatterns\AttributeProviders.py,
line 335, in _AttributeFor
(Object: GAPMixin)
  File C:\PROGRA~1\ZOPE230\lib\python\Products\ZPatterns\Expressions.py,
line 13
6, in eval
KeyError: AllotmentArea_ID

Roch


___
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] ZPatterns: getItem returns None

2001-03-19 Thread Roch'e Compaan

 On Mon, 19 Mar 2001, Roch'e Compaan wrote:
  In all simplicity I still can't get it to work but here's some more info
  from the console:
 
  Traceback (innermost last):
File
  C:\PROGRA~1\ZOPE230\lib\python\Products\ZPatterns\AttributeProviders.py,
  line 335, in _AttributeFor
  (Object: GAPMixin)
File C:\PROGRA~1\ZOPE230\lib\python\Products\ZPatterns\Expressions.py,
  line 13
  6, in eval
  KeyError: AllotmentArea_ID

 If I knew more about the internals of ZPatterns I bet this would tell me
 exactly what's wrong, but I don't, so it doesn't.  Have you looked at
 the information screen that tells you which attributes are handled by
 which providers to make sure it is your skinscript that is providing the
 attribute?  To my limited knowledge it looks like maybe the wrong
 attribute

A single line of SkinScript acts as the "Getter" for AllotmentArea_ID:
WITH QUERY sqlGetAllotmentArea(AllotmentArea_ID=self.id) COMPUTE
AllotmentArea_ID, AreaName, AreaCode

There are no persistent attribute or sheet providers - I deleted all of them
and the proxy role for the SkinScript is set to manager.  I fired up the
python debugger as well and it seems if and "instance" is retrieved but the
attribute is not computed as specified by the SkinScript.

 provider is getting into the act.  Hopefully someone with more knowledge
 than me will chime in wry grin.

We'll thanks for your pointers anyway.

Roch



___
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] ZPatterns: getItem returns None

2001-03-19 Thread Steve Spicklemire


Hi Roche,

  In all simplicity I still can't get it to work but here's some more info
  from the console:
 
  Traceback (innermost last):
File
  C:\PROGRA~1\ZOPE230\lib\python\Products\ZPatterns\AttributeProviders.py,
  line 335, in _AttributeFor
  (Object: GAPMixin)
File C:\PROGRA~1\ZOPE230\lib\python\Products\ZPatterns\Expressions.py,
  line 13
  6, in eval
  KeyError: AllotmentArea_ID


Seems like the first element of the list of result objects returned by 
sqlGetAllotmentArea doesn't define anything called 'AllotmentArea_ID'.
Could it be a case problem? What datbase/db_adaptor are you using?

You might try changing the skin-script to something like:

WITH (myDebuggingMethod(test_id = self.id) or [NOT_FOUND])[0] COMPUTE 
AllotmentArea_ID, AreaName, AreaCode

then have myDebuggingMethod call an external method to 'print' out things like
the id being used, and the contents of the results being passed back to the
attribute provider. This same method could also return a 'static' dictionary
in a list that has AllotmentArea_ID, AreaName, AreaCode defined as keys, so 
that you know they are there. There was also an exchange on the list between 
Joachim Schmitz and me back in October about some debugging strageties.
You might try to dig those up... 

-steve

___
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] ZPatterns: getItem returns None

2001-03-17 Thread R. David Murray

On Sat, 17 Mar 2001, Roch'e Compaan wrote:
 When I call getItem(existing_id) on the specialist, it returns None.

In my experience, getItem will return None if *anything* goes wrong
with data retieval or object creation.  Sometimes you get a traceback in
the STUPID_LOG, and sometimes you don't (and I haven't figured out the
pattern yet).  Test everything you can independently, and simplify
everything to the bare minimum until you get it to work, and then
add back the other variables, etc.

--RDM


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