Re: [Zope-dev] Dataskin with no persistence.

2001-04-12 Thread Steve Alexander

Godefroid Chapelle wrote:


 data plug-in : a skinscript computing attributes based on an id and the
 xml.
 
 storage :
Class to use for stored items: HumanClass
Objects are: loaded by accessing attribute nom  (which is defined in
 the skinscript)
 
 Store 'persistent' data: Directly in this object
 
 
 I store no HumanClass instance and try to get an instance :
 
 specialist.getItem(anId)
 
 I always get None.
 
 
 Am I trying to do something impossible because of lack of understanding
 or am I just wrong in one property of ZClass, Specialist, Rack ?


What you're doing sounds about right.

What does your SkinScript look like?

In the ScinScript, you need to determine what data to use based on 
self.id. Here's the SkinScript I use for a similar function; I'm 
creating "virtual" instances of one ZClass, based on instances of a 
different ZClass from another Specialist. In this case, the other 
specialist is "Responses".

WITH Responses.get_data_for_code(code=self.id) COMPUTE
   subject_name,
   rater_name,
   relationship_name,
   response_code,
   process_step


--
Steve Alexander
Software Engineer
Cat-Box limited


___
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] Dataskin with no persistence.

2001-04-12 Thread Godefroid Chapelle



Steve Alexander a crit :

 Godefroid Chapelle wrote:

 
  data plug-in : a skinscript computing attributes based on an id and the
  xml.
 

I just want to stress that I deleted every prebuilt other data plugins...

My ZClass has only an empty dataskin property sheet.


  storage :
 Class to use for stored items: HumanClass
 Objects are: loaded by accessing attribute nom  (which is defined in
  the skinscript)
 

I have changed the load attribute to id.

This helps a little : with dtml-var "getItem(REQUEST.id)" in the
specialist, I get a HumanClass Instance at xxx in the HTML code.

But when trying to access any attribute of the instance I get an
authorization error.

I remembered having seen somewhere to put a proxy role on the skinscript so I
tried.

With manager, I keep the same authorization error...

With owner or anonymous, I get a NameError on the first name mentioned in the
skinscript...


  Store 'persistent' data: Directly in this object
 
 
  I store no HumanClass instance and try to get an instance :
 
  specialist.getItem(anId)
 
  I always get None.
 
 
  Am I trying to do something impossible because of lack of understanding
  or am I just wrong in one property of ZClass, Specialist, Rack ?

 What you're doing sounds about right.

 What does your SkinScript look like?

 In the ScinScript, you need to determine what data to use based on
 self.id. Here's the SkinScript I use for a similar function; I'm
 creating "virtual" instances of one ZClass, based on instances of a
 different ZClass from another Specialist. In this case, the other
 specialist is "Responses".

 WITH Responses.get_data_for_code(code=self.id) COMPUTE
subject_name,
rater_name,
relationship_name,
response_code,
process_step

 --
 Steve Alexander
 Software Engineer
 Cat-Box limited

BTW Has there been a patch for an error I get when using copy or cut buttons
in ZPatterns containers :

Zope Error

   Zope has encountered an error while publishing this resource.

   Error Type: KeyError
   Error Value: manage_tabs


--

Godefroid Chapelle

BubbleNet sprl
rue Victor Horta, 30
1348 Louvain-la-Neuve
Belgium

Tel 010 457490
Mob 0477 363942

TVA 467 093 008
RC Niv 49849



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