Re: [Zope-dev] Future of ZPatterns

2002-04-15 Thread Steve Spicklemire

Hi Marcello,

Wow.. sounds like a neat book. ;-) Seriously, Phil Eby has 
suggested that there will be some sort of migration helpers to move from 
ZPatterns to TransWarp (www.eby-sarna.com):

http://www.eby-sarna.com/mailman/listinfo/transwarp

http://cvs.eby-sarna.com/TransWarp/

Also.. Zope3 will have a some kind of Zope2 compatability layer, so in 
principal, it should be possible to move ZPatterns apps to Zope2 using 
the compatability layer. I, for one, have a slew of ZPatterns apps out 
there, so I will be motivated to do something about migration.

-steve

On Monday, April 15, 2002, at 02:11 PM, Marcello Parra Martins wrote:

 Hello,
  
 I'm new to Zope. I'm studing 'Zope Web Application Develepment and 
 Content Management' book.
 Many of the examples of the book uses ZPatterns.
 I saw in past messages that ZPatterns will not be supported in Zope3.
  
 Is this true ?? If I create a product based on it, will it be a lost of 
 time ???
  
  
 Thanks,
  
 Marcello Parra
  
  



___
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] Separate staging and development areas for a product

2002-04-15 Thread Steve Spicklemire


I think it's worth having a completely separate Zope. Otherwise there's 
no way to separate development and staging versions of filesystem based 
products. You might be interested in ZSyncer, or ZCVSFolder for 
synchronization.

-steve

On Monday, April 15, 2002, at 12:12 PM, Ted Skolnick wrote:

 Hi,
 I have a Zope product in development.  I want to setup a staging area 
 for
 stable releases and I am not sure how to go about it.  I could install
 another Zope in a different directory, but it seems like I should be 
 able to
 do it with the Zope instance I've got.  Any thoughts, or pointers?

 My project contains ZSQL methods and external methods, if that is
 significant.  It seems like the external methods could be a rub, since 
 they
 exist as files in the Zope installation directories (specifically in the
 Extensions directory).   I don't know how I could have multiple 
 versions of
 these files, one for development, one for staging all within one 
 instance of
 Zope.

 One lesser question, newbie question... how do I control the URL to 
 reach
 the methods exposed in my project. For example, I have a product called
 myproj, with my method.  The only URL I can get to work is this
 http://myserver/Control_Panel/Products/myproj/mymethod

 I'd like to have a URL that looks like this...
 http://myserver/myproj/mymethod   without the Control_Panel bit.

 thanks,
 Ted



 ___
 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 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] Manual object-to-relational persistency framework

2002-03-09 Thread Steve Spicklemire

Thanks Dieter,

I think ZPatterns is certainly worth a look. It allows you to 
slice-and-dice what you want to store in ZODB or RDBMS. The best part is 
you can develop totally in ZODB, then migrate to RDB a bit at a time (if 
you like) without changing your app, or your data classes. We have 
multiple instance of the same app mixing up ZODB, RDB, LDAP etc..  since 
all the wiring of data-objects is done in configurable data managers on 
an instance by instance basis.

http://www.zope.org/Members/pje/ZPatterns

for Zope-2.[45].x see also:

http://www.cat-box.net/steve/TransactionAgents

Three chapters of our book (www.zopeonarope.com) are devoted to 
implementing ZPatterns based apps.

good luck!
-steve


On Friday, March 8, 2002, at 02:56 PM, Dieter Maurer wrote:

 Bjorn Stabell writes:
 I'm trying to use Zope without storing everything in ZODB while still
 having the perception of an object-oriented database.  I want to 
 control
 the object-to-relational mapping layer, but would like the loading and
 saving of objects to be automatic.  Is there some way to do that using
 Zope?
 Maybe ZPattern?


 Dieter

 ___
 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 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 Zclass + Folder subclassing problem

2001-11-30 Thread Steve Spicklemire


Hi Jean,

You might get more feedback from the ZPatterns list on something 
like this. My gut reaction is that subclassing in python 2.1/1.5 
traverses the classes to find methods in a way that makes the *order* of 
classes very important. IIUC Python 2.2 has a much more sophisticated 
attribute searching scheme, so that this will be easier to get right.. 
but so far Zope and 2.2 don't mix so well. You are no doubt getting the 
wrong class/attributes when you call objectIds etc. Can you try making 
ZClass1 a simple class and ZClass2 subclassing from DataSkin, Folder and 
*then* ZClass1?

good luck!
-steve

On Tuesday, November 27, 2001, at 12:36 PM, Jean Lagarde wrote:

 Hi all,

 A ZClass inheriting from both DataSkin and Folder seems to work as
 expected (so much has been discussed in other messages, at least with
 ObjectManager). However, instead of inheriting directly from DataSkin, I
 want to inherit from another Zclass which is itself based on DataSkin,
 i.e. (not showing Zobjects):

  DataSkin  ZClass1Folder
 | \ /
 |  \   /
 v   v v
  ZClass1ZClass2

 After its creation, the new Zclass ZClass2 seems to have some management
 issues:

 - The views are initialized to those of ZClass1; no big deal, for now, I
 just added a new view tab named Contents for manage_main

 - When I create an instance of ZClass2 (in a Folder w/Customizer
 Support), the instance does show its Contents tab, but it does not quite
 know it's folderish:

   - It does not show in the left pane of the ZMI

   - If I add an object from the contents tab interface of the instance,
 say a dtml method, it adds OK, but does not show in the contents tab
 (the contents view is always empty no matter what I add)

   - The objects I added are there; I can traverse to them and their
 management interfaces, and I have also checked the ZODB directly using
 the wonderful pyTree.py.

 I'm afraid that I know just enough about Zope to be dangerous ;-) I
 basically just have the time to learn about the stuff that I need to get
 the job done, and I'm sure that the current version of what I'm working
 on will need some refactoring later on. So I have two questions:

 1) Anybody can think of a quick fix to get the folderish behavior
 working as it should?

 2) In its current state (if there is no quick fix), ZClass2 seems usable
 enough for my needs; I just need to add a couple of objects for each
 instance, and I can reach their management screens through explicit
 traversal. So I'm tempted to plug along and keep on experimenting with
 that setup for now. Any other more important consequences that I'm
 missing that should have me fix this more adequately before I proceed?

 Cheers,

 Jean




 ___
 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 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] validate() trouble in Zope-2.5.0a1

2001-10-28 Thread Steve Spicklemire


I don't know if I'm doing something wrong, but when I try to unpack and 
run Zope-2.5.0a1 I can't seem to authenticate manage_workspace. I 
haven't snooped much, but it seems that options in Management.py comes 
back empty:

  
/usr/local/etc/Zope2d/lib/python/App/Management.py(147)manage_workspace()
- try:
(Pdb) print options
[]
(Pdb) l
142 
143 import pdb
144 pdb.set_trace()
145
146 options=self.filtered_manage_options(REQUEST)
147  - try:
148 m=options[0]['action']
149 if m=='manage_workspace': raise TypeError
150 except:
151 raise Unauthorized, (
152 'You are not authorized to view this object.')


When I look into

self.filtered_manage_options(REQUEST)

it seems that getSecurityManager.validate always throws an exception 
this function takes no keyword arguments

  
/usr/local/etc/Zope2d/lib/python/App/Management.py(130)filtered_manage_options(
)
- if validate(container=self, value=o):
(Pdb) n
TypeError: 'this functio...ord arguments'
  
/usr/local/etc/Zope2d/lib/python/App/Management.py(130)filtered_manage_options(
)
- if validate(container=self, value=o):
(Pdb) n
  
/usr/local/etc/Zope2d/lib/python/App/Management.py(132)filtered_manage_options(
)
- except:
(Pdb) l
127 if o is None: continue
128
129 try:
130 if validate(container=self, value=o):
131 result.append(d)
132  - except:
133 if not hasattr(o, '__roles__'):
134 result.append(d)
135
136 return result

(Pdb) print __exception__
(class exceptions.TypeError at 0x80ec60c, 'this function takes no 
keyword arguments')
(Pdb)

Anyway.. no more time to play now.. any idea what's up?

thanks,
-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] zope redistibution

2001-10-20 Thread Steve Spicklemire

Hi Lukas,

Have you tried a simple export/import?

-steve

On Thursday, October 18, 2001, at 07:44 PM, Lukas Maag wrote:

 hi,
 i use zope 2.4.1 and the redistribution fuction works not. i can not 
 distribute
 a product under allowance of redistribution. if i want to distrbute on 
 another
 zope installation it says, that this is not redistributable, although i 
 marked
 explicitely 'allow redistribution' on the other distribution!
 it's now a problem for me, because i relied on this. i can not reuse my 
 improved
 product!
 can anyone help me, please.
 thanx

 lukas

 ___
 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 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] Curiously Zope Hanging

2001-07-12 Thread Steve Spicklemire


Hi Andre,

What OS? I've had lots of trouble with Postgres and threads on FreeBSD. Have
you tried starting Zope with '-D' to see if threads are an issue?

-steve

Andre Schubert wrote:
 
 Hi all,
 
 I have a problem with my Zope, he hangs unexpectly if i view a special
 Method which generates Diagrams with data from a PostgresDB.
 The data are selected by a timespan( default is 24 Hours ).
 The Method works as descripted bellow:
 
 First when i call foo, then the HTML-Code is rendered with some
 images-tags, which are generated by selects.
 The image tags are calling the method foo which returns image data.
 
 If i want my diagrams from 2001-06-01 5:00 to 2001-06-01 12:05
 everything works fine.
 If i want my diagrams from 2001-06-01 5:00 to 2001-06-01 12:10 Zope
 hangs, no exception no log entry, Zope only hangs.
 If i want my diagrams from 2001-06-01 5:05 to 2001-06-01 12:10 which is
 the same timespan as example 1 Zope hangs too, no exception no log
 entry, Zope only hangs.
 
 If i view the postgres logs the nothing happens.
 
 Could anyone help me to find the problem or the place Zope is hanging
 
 thanks as
 
 P.S.: Exact the same problem occurs when i you another PostgresDA 
 
 ___
 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 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] Curiously Zope Hanging

2001-07-12 Thread Steve Spicklemire


Well, the good news is you have a reproducable symptom! 

Some suggestions:

1) Try the quer(y/ies) that cause the hang separately to make sure they return OK.

2) Create a Python script/Tiny table/Gadfly query that returns data that looks
just like the result of your postgresql query to test the rest of your system.
(these two just isolate the problem to postgres or Zope)

3) Get out the debugger and step through the publisher to see where it's
hanging.. (in -D mode you can also 'print' in python and the results will appear
on stdout of the 'start -D' process.

4) Post some real code so we can see what you're really up to (!?)

-steve

Andre Schubert wrote:
 
 Hi Steve,
 
 Immunix Redhat 6.2
 Zope 2.3.3
 Postgres 7.1.2
 
 I'am running Zope with -M -D and with Stupid_log_file. But i don't find a problem.
 When Zope hangs, then there is one Thread Running and if i trace this Thread nothing
 happens.
 
 as
 
 Steve Spicklemire schrieb:
 
  Hi Andre,
 
  What OS? I've had lots of trouble with Postgres and threads on FreeBSD. 
Have
  you tried starting Zope with '-D' to see if threads are an issue?
 
  -steve
 
  Andre Schubert wrote:
  
   Hi all,
  
   I have a problem with my Zope, he hangs unexpectly if i view a special
   Method which generates Diagrams with data from a PostgresDB.
   The data are selected by a timespan( default is 24 Hours ).
   The Method works as descripted bellow:
  
   First when i call foo, then the HTML-Code is rendered with some
   images-tags, which are generated by selects.
   The image tags are calling the method foo which returns image data.
  
   If i want my diagrams from 2001-06-01 5:00 to 2001-06-01 12:05
   everything works fine.
   If i want my diagrams from 2001-06-01 5:00 to 2001-06-01 12:10 Zope
   hangs, no exception no log entry, Zope only hangs.
   If i want my diagrams from 2001-06-01 5:05 to 2001-06-01 12:10 which is
   the same timespan as example 1 Zope hangs too, no exception no log
   entry, Zope only hangs.
  
   If i view the postgres logs the nothing happens.
  
   Could anyone help me to find the problem or the place Zope is hanging
  
   thanks as
  
   P.S.: Exact the same problem occurs when i you another PostgresDA 
  
   ___
   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 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 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] Curiously Zope Hanging

2001-07-12 Thread Steve Spicklemire


Hi Andre,

Andre Schubert wrote:
 
 No, the problem is not reproduceable, because if move the timespan 5 minutes earlier 
then
 Zope crashes. And thats the problem.

Hmm.. my point was only that if you can *predict* correctly when Zope will
hang.. then it is at least 'reproducable'.

 If i call my diagrams in the order that a is the same and b is changing everything 
works
 well and there are absolutely no hangs,
 but if i call my diagrams the other way that a is changing and b is the same then 
Zope
 works if i select data from
 2001-06-01 5:00 to
 2001-06-20 12:05
 and Zope hangs if i select data from
 2001-06-01 5:00 to
 2001-06-20 12:10
 or from
 2001-06-01 5:05 to
 2001-06-20 12:10
 
 I hope you understand my explanations in my bad german-english.

I think I get the basic picture... but 
 
 as
 
 Steve Spicklemire schrieb:
 
  Well, the good news is you have a reproducable symptom!
 

___
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] Curiously Zope Hanging

2001-07-12 Thread Steve Spicklemire


Sorry.. got distracted and forgot where I was!

 
 I think I get the basic picture... but

I think maybe we need more details of your system to be of any more help.. 

-steve

 
  as
 
  Steve Spicklemire schrieb:
 
   Well, the good news is you have a reproducable symptom!
  
 
 ___
 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 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] SQL/ZPatterns examples posted to Zope.org

2001-07-10 Thread Steve Spicklemire



I've had several folks ask for some ZPatterns examples with SQL. I've
*finally* gotten around to providing them.

They're at: http://www.zope.org/Members/sspickle 

The first is a school attendance application 'skeleton' with the
following description:

An example of ZPatterns using SQL. Gadfly is the database so everyone
can use it. There are a couple of novel aspects 1) a 'generic' object
management UI that is acquired by all the Specialists and 2) levers to
manage all the SQL and SkinScript.

After you have the products and folder installed, you'll need to create
the database tables (run createAllTables_html) and then add some data.
There is a very crude admin UI for each Specialist that you can get to
from the main 'view' page by clicking on the link for that Specialist.
Follow the object model:attendanceModel.gif to see how to hook things up.

If you change any of the ZClass propertysheets you'll need to rerun the
levers to create all the SQL queries and SkinScript. (You'll probably
also need to drop/re-create the relevant database tables)

The second is a school lunch application 'skeleton' which is 99%
similar, except that it uses a filesystem base class for the 'Lunch'
object, just to show how it can be done.

Feedback most welcome!

thanks,
-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 )



[Zope-dev] Re: [ZPatterns] HowTo: Make an Image/File a DataSkin ???

2001-07-10 Thread Steve Spicklemire



Hi Ulrich,

Hmm.. can you just call DataSkin.__init__(self, id) in the File's constructor?

-steve

Ulrich Eck wrote:
 
 Hello .. sorry I bother you again with my ZPatterns
 related Questions ..
 
 I just try it once again ;-)
 
 I have a Folder w/Customizer in that I want to store Objects
 of type Image or File (CMFDefault.Image to be correct) in it.
 
 The inline doku of CMFDefault.File/Image says the following:
 
 --
 class File(OFS.Image.File
   , PortalContent
   , DefaultDublinCoreImpl
   ):
 
 A Portal-managed File
 
 
 # The order of base classes is very significant in this case.
 # Image.File does not store it's id in it's 'id' attribute.
 # Rather, it has an 'id' method which returns the contents of the
 # instnace's __name__ attribute.  Inheriting in the other order
 # obscures this method, resulting in much pulling of hair and
 # gnashing of teeth and fraying of nerves.  Don't do it.
 #
 # Really.
 #
 # Note that if you use getId() to retrieve an object's ID, you will avoid
 # this problem altogether. getId is the new way, accessing .id is
 # deprecated.
 
 --
 
 this is fairly true. I needed to make the DataSkin the first subclass
 of File to ensure the datamanager-machinery will work (not_found v_dm)
 
 for example:
 class File(DataSkin
   , OFS.Image.File
   , PortalContent
   , DefaultDublinCoreImpl
   ):
 
 this basically works fine except when I rename this object the different behaviour
 of Dataskin (stores its id in self.id) and Image/File (stores its id in self.__name__
 and recommends the use of ob.getId() to get the id).
 
 Has anyone used a Image/File/ExtFile class for combining it with ZPatterns.DataSkin
 and perhaps give me a hint ??
 
 thanks
 
 Ulrich Eck
 net-labs
 
 ___
 ZPatterns mailing list
 [EMAIL PROTECTED]
 http://www.eby-sarna.com/mailman/listinfo/zpatterns

___
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] DateTime class not recognizing timezone correctly...

2001-07-08 Thread Steve Spicklemire

Hi -dev folk.. 

I ha(d) a problem where DateTime was basing the local timezone on
time.tzname, and getting it wrong. (tzname comes from the abbreviation,
which in Indiana is 'EST', but DateTime really wants 'US/East-Indiana'.
So.. I patched DateTime as follows.. I saw a proposal in the archives
about this kind of solution. Any other ideas? How are other folks
handling this?

thanks,
-steve

diff DateTime.py myDateTime.py
96,97c96,107
 try: from time import tzname
 except: tzname=('UNKNOWN','UNKNOWN')
---
 
 tzname = None
 try:
 from localzoneinfo import tzname
 except:
 pass
 
 try:
 if tzname is None:
 from time import tzname
 except:
 tzname=('UNKNOWN','UNKNOWN')

___
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] ZCVSFolder not running on windows

2001-07-01 Thread Steve Spicklemire


Hi Robert,

Sorry.. ZCVSFolder is not supported for Windows. Patches accepted!

-steve

Robert Rottermann wrote:
 
 Hi there,
 
 I installed the newest version of ZCVSMFolder on my windowsbox.
 
 As it uses fork it can not work. However I used a former version under
 windows. Is this not possible anymore?
 
 thanks for any insigth
 
 Robert
 
 ___
 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 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] getPersistentItemIDs not cooperating?

2001-05-23 Thread Steve Spicklemire


Has anyone seen anything like this?

I have the following script in a Specialist:

## Script (Python) deleteAllTracks
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
trackMaster=context.Tracks

import string

iList=[]

for id in trackMaster.defaultRack.getPersistentItemIDs():
iList.append(id)
theItem=trackMaster.getItem(id)
iList.append(theItem.manage_delete())

return OK! deleted: + string.join(iList,',')

It works.. partially. For some reason it looks like getPersistentItemIDs 
does not always return a *complete* list. I need to run this method 
several times to completely exhaust the Rack's storage. Thoughts? The 
only way I ever create Track objects is via a different method that is 
only accessed once (a long time ago!)

thanks,
-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] getPersistentItemIDs not cooperating?

2001-05-23 Thread Steve Spicklemire

Well.. it turned out to be more subtle.

It goes back to the old problem that getPersistentItemIDs doesn't return 
a real list, but rather a BTreeItems object. When you call manage_delete 
on *one* item, it affects the BTreesItems object you are iterating over!

This works:

## Script (Python) deleteAllTracks
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
trackMaster=context.Tracks

import string

iList=[]

for id in trackMaster.defaultRack.getPersistentItemIDs():
iList.append(id)

dList=[]
for id in iList:
theItem=trackMaster.getItem(id)
theItem.manage_delete()
dList.append(id)


return (OK! deleted %i elements % len(iList)) + string.join(iList,',')



On Wednesday, May 23, 2001, at 10:59 AM, Steve Alexander wrote:

 Steve Spicklemire wrote:

 Has anyone seen anything like this?
 snip
 It works.. partially. For some reason it looks like 
 getPersistentItemIDs does not always return a *complete* list. I need 
 to run this method several times to completely exhaust the Rack's 
 storage.


 Yes, I've seen this. It's on my list of things to look into when I've 
 got a certain large project out of the way :-/

 Thoughts?



 Well, getPersistentItemIDs() just returns the result of calling keys() 
 on the Rack's BTree.


 I guess it is a problem with the BTree code.

 I doubt it'll be fixed though. Instead, we should update Rack to use 
 the new BTrees module.

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

___
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] getPersistentItemIDs not cooperating?

2001-05-23 Thread Steve Spicklemire

Hi Phil,

Yup.. I realized it when I could *list* all the ids, but not delete 
them. ;-) I'm wondering if it might be better to change the 
implementation of getPersistentItemIDs to return a plain list? This 
would also help avoid permission errors that folks run in to when trying 
to use it in dtml. I realize that listifying takes time, but you 
probably wouldn't call it if you had a very large number of items in the 
rack (you'd maybe query a catalog or something else.. )

-steve

On Wednesday, May 23, 2001, at 11:22 AM, Phillip J. Eby wrote:

 At 05:48 PM 5/23/01 +0200, Christian Scholz wrote:
 Hi!

  It works.. partially. For some reason it looks like 
 getPersistentItemIDs
  does not always return a *complete* list. I need to run this method
  several times to completely exhaust the Rack's storage. Thoughts? The
  only way I ever create Track objects is via a different method that 
 is
  only accessed once (a long time ago!)

 Well, I experiences something similar when changing a Racks storage
 from persistent to non-persistent. The included objects are marked
 as orphaned then and should be deleted with the Clear-Button. This
 also works, but only the half of them gets deleted every time I click
 on that button.. So I also have to press it several times.. Sounds like
 the same problem..

 I just thought of how this happens...  if you delete an object from the 
 Rack, it's being removed from the virtual list of keys your loop is 
 traversing.  So as you iterate from 0..n, and you delete  items from 
 the rack, they are removed from the keys list too, the list shortens, 
 and every other item in the list is skipped!  This is why you get half 
 the list every time.

 The fix would probably be:

 foo = getPersisentItemIDs()

 while foo:
 foo[0].manage_delete()

 I should probably do this in ZPatterns too.  I'm working on upgrading 
 it for 2.3.2 right now anyway.

___
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) Speeding up Skinscripts

2001-03-29 Thread Steve Spicklemire


Hi John,

   Makes sense to me! I'm guessing eval was used since it's a little
simpler not to have to keep track of both the string expression and
the compiled expression.. but that's just a guess. However it does
bring up a point I've been wondering about anyway. Now that Ty and
Phillip have moved on to TransWarp, who will be maintaining all the
changes to ZPatterns? SteveA has done a great job of keeping a
modified version available for folks running 2.3.X, but I've seen no
motion to move those changes into the "real" ZPatterns. Now if you
find a great optimization, will it get movedinto ZPatterns too? There
are a number of folks now whove contributed to the 'ZPatterns' project
and have invested significant effort in projects that are based on
ZPatterns, and would like to see it maintained. (me!) I wonder if
there is some way that stewardship for ZPatterns could be either
'handed off' or 'shared' so that these kinds of things can be kept
up-to-date without delaying the promised TransWarp goodies. 

What do you think? 

take care,
-steve

 "JAE" == John Eikenberry [EMAIL PROTECTED] writes:

JAE We have a fairly large and complex app framework built on
JAE ZPatterns. It uses MySQL for storage and the standard
JAE Specialist/Rack/DataSkin setup with skinscripts for
JAE attributes and triggers.

JAE We've found that the speed of getItem is a bit slower than we
JAE need. For instance retrieving 200 dataskins takes about 8
JAE seconds on a P2-300. After profiling and digging around I
JAE think I've found the primary bottleneck. Its the running of
JAE eval() on the skinscript's python expression (stored in the
JAE Compute class as _fromex and Triggers as callexpr).

JAE Note that this becomes the bottleneck after the SQL Method
JAE gets cached. The query to the DB takes the most time on the
JAE first hit, but after its been cached it takes very little
JAE time.

JAE The optimization I've been looking at is changing the code
JAE from storing a string and eval()ing the string to using
JAE compile() at save time and exec() when evaluated.

JAE Profiling these 2 ways in little test programs seems to
JAE indicate about a 2.5x speedup. Not huge, but combined with
JAE better hardware should be enough.

JAE But I'm curious why this avenue wasn't taken to begin
JAE with. Seems like the way to do it to me. Am I missing
JAE something?

JAE --

JAE John Eikenberry [[EMAIL PROTECTED]]
JAE __
JAE "A society that will trade a little liberty for a little
JAE order will deserve neither and lose both."  --B. Franklin

JAE ___ Zope-Dev
JAE maillist - [EMAIL PROTECTED]
JAE http://lists.zope.org/mailman/listinfo/zope-dev ** No cross
JAE posts or HTML encoding!  ** (Related lists -
JAE http://lists.zope.org/mailman/listinfo/zope-announce
JAE http://lists.zope.org/mailman/listinfo/zope )


___
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] Btree problems on recent CVS update..

2001-03-28 Thread Steve Spicklemire


Hmm.. anybody seen this?

-steve

cc -fpic  -I../Components/ExtensionClass/src -I../Components/BTree -I./ZODB -O -pipe 
-D_THREAD_SAFE -I/usr/local/include/python1.5 -I/usr/local/include/python1.5 
-DHAVE_CONFIG_H -c ./../Components/BTree/BTree.c
./../Components/BTree/BTree.c: In function `BTreeItems_item_BTree':
./../Components/BTree/BTree.c:249: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c:249: (Each undeclared identifier is reported only once
./../Components/BTree/BTree.c:249: for each function it appears in.)
./../Components/BTree/BTree.c: In function `BTreeItems_item':
./../Components/BTree/BTree.c:299: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `bucket_index':
./../Components/BTree/BTree.c:471: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `_bucket_get':
./../Components/BTree/BTree.c:509: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `BTree_index':
./../Components/BTree/BTree.c:596: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `_BTree_get':
./../Components/BTree/BTree.c:647: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `_bucket_set':
./../Components/BTree/BTree.c:749: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `BTree_grow':
./../Components/BTree/BTree.c:961: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `_BTree_set':
./../Components/BTree/BTree.c:1028: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `bucket_keys':
./../Components/BTree/BTree.c:1099: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `bucket_values':
./../Components/BTree/BTree.c:1129: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `bucket_items':
./../Components/BTree/BTree.c:1159: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `bucket_clear':
./../Components/BTree/BTree.c:1209: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `BTree_clear':
./../Components/BTree/BTree.c:1265: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `bucket_getstate':
./../Components/BTree/BTree.c:1294: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `BTree_getstate':
./../Components/BTree/BTree.c:1759: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `BTree_elements':
./../Components/BTree/BTree.c:1851: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `Bucket_length':
./../Components/BTree/BTree.c:1986: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `BTree_length':
./../Components/BTree/BTree.c:2002: `cPersistenceCAPI' undeclared (first use in this 
function)
./../Components/BTree/BTree.c: In function `initBTree':
./../Components/BTree/BTree.c:2122: `cPersistenceCAPI' undeclared (first use in this 
function)

___
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] FTP interface being worked on?

2001-03-27 Thread Steve Spicklemire


Hi Fred,

 "Fred" == Fred Wilson Horch [EMAIL PROTECTED] writes:

Fred Wanted to follow up on Steve's points.

Fred I don't know if we need just one serialization interface
Fred that tries to solve all five issues.

Ok.. 

Fred We currently have two serialization interfaces in Zope:

Fred  1) the FTP interface, and 2) the XML export interface.

Fred Seems to me that the FTP interface could be generalized as
Fred the "lossy" serialization interface that is "morally human
Fred readable" and the XML export interface could be tweaked a
Fred bit as "lossless" but "morally binary".

Fred The FTP interface would be used when you want a
Fred representation that can be edited by hand.  It solves C, D
Fred and E, but not A and B.

Fred The XML interface would be used when you want a
Fred representation that can be manipulated programmatically.  It
Fred solves A and B, but not C, D and E.

Hmm.. maybe I'm misuderstanding... which would/could you use for
version control? It still seems to me that a blend of these could be
developed that would work in all cases. An object could have a human
readable part/aspect and 'the rest' could be captured as an xml
bloblet. The 'human editable' part could just be what you get on the
FTP interface (as you say), and the rest could be saved/restored to a
'auxiliary' file that would track other aspects of the object.  Since
objects could implement their own serialization, they could decide
what aspects belonged in which part.  Otherwise I can't help feeling
that we'd have problems with duplicated versions, some xml/zexp, some
human-readable that would inevitably stomp on eachother in any version
control scenario. If all this could be worked in to the existing
FTP/export/import system... there would be a minimum impact on 
existing interfaces.

Fred FWIW, I'm working on tweaking the XML export/import code to
Fred serialize object hierarchies as directories and files,
Fred rather than exporting a single file.

Cool.. this sounds like a promising approach. I'd be interested
in testing this.. 

thanks!
-steve

Fred Fred

Fred P.S.  The link Karl sent
Fred (http://www.thetwowayweb.com/theXmlFiles) is interesting.
Fred -- Fred Wilson Horch mailto:[EMAIL PROTECTED] Executive
Fred Director, EcoAccess http://ecoaccess.org/ P.O. Box 2823,
Fred Durham, NC 27715-2823 phone: 919.419-8354


___
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] FTP interface being worked on?

2001-03-26 Thread Steve Spicklemire


Hi Fred,

 "Fred" == Fred Wilson Horch [EMAIL PROTECTED] writes:

Fred Steve Spicklemire wrote:

 I'm looking at all this from the perspective of someone who is
 using the current xml/zexp code to manage objects in CVS today

Fred Can you tell me how you do that?  Our big problem is that we
Fred can't import over existing objects.  Are we doing something
Fred wrong?

I use ZCVSMixin (http://www.zope.org/Members/sspickle/ZCVSMixin).

Fred Here's our set up:

Fred We have developers all over the world that can check code in
Fred and out of SourceForge.  We'd like our developers to be able
Fred to work on our site using their own local instances of Zope,
Fred export everything from their Zope ODB to their local
Fred filesystem, then use CVS to check in all the changes they've
Fred made to SourceForge.  Then to keep in synch, everyone else
Fred can update their local copies of the source tree, and import
Fred the updates into their local instances of Zope.

Fred The problem: imports raise all sorts of conflict errors --
Fred we basically have to delete everything before importing it.

ZCVSMixin does the loading of objects into folderish containers
so conflict errors are not a problem. This naturally means that
you can destroy things if you're not careful. (Motto: a tool that
doesn't let you destroy things now  then.. is a weak tool.)

-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] FTP interface being worked on?

2001-03-24 Thread Steve Spicklemire


Hi Folks,

I posted this to the Wiki... but it's not "in-your-face" like email,
so I never know if anyone reads it. Here are a few, possibly random,
but nonetheless concrete, thoughts of mine on the matter. I'm looking
at all this from the perspective of someone who is using the current
xml/zexp code to manage objects in CVS today, and hoping that whatever
evolutionary/revolutionary process that occurs here not completely
break all my existing stuff. It seems to me that the current import/export
mechanism is actually pretty close to what we need for serialization. It
has some nice  properties:

A) All objects are faithfully encoded and saved on the filesystem
  in a text format that any configuration management system can
  use and track. It seems to me that this property is critical
  to maintain.

B) Whole object hierarchies can be saved in a simple file, moved
  to any other zope instance (via checkin/checkout) and instantiated.
  (This is needed for import/export to be useful)

C) It's possible (through a hack[1]) to make simple objects 'diff'able
  so that all the metadata that's in the current xml export rep doesn't
  get in the way too much. (this is almost irrelavent, but may be
  useful as an interem step to make this part of the native import/export
  code... )

There are also a few not-so-nice properties:

D) The current xml representation use by xml import/export is morally
  binary, in the sense that you can't easily edit/manage it with
  ordinary editors etc.

E) There is no simple way to separate the contents of a containerish
  object from the container. 

I think that both of these shortcomings could be addresses using Chris M's
idea of letting objects handle their own serialization. (e.g., Folders
could save their meta-data in a 'special' file, or directory and then
proceed to call the serialization methods of their contents). However
I think there would be benefits to working this into the current
import/export scheme. Imagine the following:

A 'serialization' interface is invented that objects could implement
that preserve A-C, and, optionally, fix D-E. If no such interface
is found, the current export method is invoked. (I suppose this could
also be done by adding a default implementation of the interface
that simply does what the current import/export code does.) 

Something like this maybe?

class FSObject:

  """ Abstract filesystem Object that 'does the right thing'. 
  Might be implemented as StringIO, or impose special
  security restrictions, or whatever. 
  """

  def chdir(.. )

  def mkdir(.. )

  def open(.. )

class Serializable:

  Serialize(self, serialize_contents_separately=None, use_fs_object=None):

  """ Serialize this object. If serialize_contents_separately is
  not None then create a 'special' file for meta_data, and
  create a new directory for self and subobjects. After saving
  meta_data, call Serialize on each content object in turn,
  passing appropriate arguments through.. """


Anyway.. it seems to me that this sort of approach would have the
benefit of using what's available today to the best advantage while
permitting tools to be developed that would work well with whavever
serialization process that evolves for all the Zope objects that
are out there.. 

take care,
-steve

[1] See the ZCVMixin product: ZCVSExIm.py 

 "CM" == Chris McDonough [EMAIL PROTECTED] writes:

CM I think the only good reasons we have right now for having
CM filesystem-compatible serialization are to make Zope content
CM editable via common tools in a way that makes sense to people
CM not used to (or comfortable with) the object database, and to
CM give people a plausible way to put a Zope site under source
CM control.

CM Are you thinking that we would build client-side tools to
CM recognize an XML representation of a subpart of a site?


CM - Original Message - From: "Karl Anderson"
CM [EMAIL PROTECTED] To: "Chris McDonough"
CM [EMAIL PROTECTED] Cc: "John D. Heintz"
CM [EMAIL PROTECTED]; "Fred Wilson Horch"
CM [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday,
CM March 22, 2001 8:17 PM Subject: Re: [Zope-dev] FTP interface
CM being worked on?


 "Chris McDonough" [EMAIL PROTECTED] writes:
 
  I don't think it's reasonable or wise to impose any "master 
 structure" for filesystem serialization of bodies of  objects.
 Each instance (or perhaps each class) should  define how best
 to serialize itself to disk.   Representations between classes
 are likely to be radically  different.  A place for
 standardization is in the  "properties" file(s) which
 accompany each object rep... this  is likely to be XML or
 another structured variant.
 
 Is there a motivation for using serialization to provide an
 editable "god's eye view" of all or part of a Zope site?
 
 That is, provide a 

Re: [Zope-dev] ZPatterns style question

2001-03-21 Thread Steve Spicklemire


Hi Lex,

This is a little bit of a tricky question.  Here is what I think is the 
*intent* of ZPatterns. The details of storage are to be left up to the
implementor/integrator. Given that they are the only ones who really know where
all the goodies are hidden (sql? zodb? etc.. ) your app shouldn't 
assume any particulars here. What your app *can* do is demand that the
objects that are used satisfy a particular interface (e.g., have
certain methods or attributes that behave in particular ways.). With
ZPatterns, what look like attributes can really be methods, due to
the flexible nature of SkinScript. I see in your tutorial that you're
trying to help the integrator by putting SkinScript in for them...
but I think that in ZPatterns, it's probably better to leave that
up to them... or at least to assume ZODB ( something everyone has)
rather than SQL. Does any of that make sense?

take care,
-steve

 "Lex" == Lex Berezhny [EMAIL PROTECTED] writes:

Lex Hello,

Lex   I dont know if i'm missing something, or if this is just a
Lex style question. But where do the implimentation specific
Lex get/set methods go (the functions called within a SkinScript
Lex for example)? Do i just stick them anywhere in the aquistion
Lex path, or is there some logical place I should place them? How
Lex can I write my application so that the user can switch data
Lex sources with a click of a button (ie, without having to
Lex delete one implimentations' methods, and paste the new ones)?
Lex I hope my question makes sense.

Lex BTW once i figure this out, i'll be able to finish my
Lex tutorial on ZPatterns:

Lex http://www.zope.org/Members/eukreign/ZPatternsTutorial

Lex  - lex

Lex __ Do You
Lex Yahoo!?  Get email at your own domain with Yahoo! Mail.
Lex http://personal.mail.yahoo.com/

Lex ___ Zope-Dev
Lex maillist - [EMAIL PROTECTED]
Lex http://lists.zope.org/mailman/listinfo/zope-dev ** No cross
Lex posts or HTML encoding!  ** (Related lists -
Lex http://lists.zope.org/mailman/listinfo/zope-announce
Lex http://lists.zope.org/mailman/listinfo/zope )


___
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] Implementing ZPattern: Containment

2001-03-21 Thread Steve Spicklemire


Hi Johan,

I wrote:

 The best way I've found is to provide a method (or methods) in the 
 Specialist of the contained item to get ids of those instances satisfying certain 
 criteria... 
 
 e.g., getToDoIdsForDoer( aDoer )
 
 (the contained item keeps a reference to the id of its container.)

then you replied:

 How well does this apply to the WhoIKnow pattern?
 Could you say that the Specialist is the association?
 In that case how do I create a n-n relation, or maybe I never do that?
 I can't really find any Patterns that matches n-n situation, so I assume
 it my modell probally would wrong if I end up with that, right?
 


then I went on vacation. ;-)

I think that in most of these situations you can have a 'catalogish' method in
the Specialist that manages the 'n' things that finds those related to the '1'.
(e.g., getToDoIdsForDoer( aDoer )). This can then be mapped to an attribute
of the '1' specailist (myToDos), so that it does 'know' about all it's todos,
its just that under the covers (in it's rack) the myToDos attribute is really
fulfilled by calling the todos specialist and asking for all the todos assocaited
with a particular doer. In the n-n case it's really no different, except that
each 'n' thing needs to know which of the other 'n' thing(s) it's associated with
so the catalogish method can pull out the ids. 

fun eh?

take care,
-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-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 feature patch: kickTriggers

2001-02-23 Thread Steve Spicklemire


Hmmm... 

tripTriggers(...)

pullTriggers(...)

fireTriggers(...)

;-)

dunno... kickTriggers works for me... 

-steve

 "SA" == Steve Alexander [EMAIL PROTECTED] writes:

SA I've patched DataSkins.py to add this method:
...

SA I'd welcome suggestions on a better name for the method than
SA "kickTriggers". :-)

SA -- Steve Alexander Software Engineer Cat-Box limited
SA http://www.cat-box.net



SA ___ Zope-Dev
SA maillist - [EMAIL PROTECTED]
SA http://lists.zope.org/mailman/listinfo/zope-dev ** No cross
SA posts or HTML encoding!  ** (Related lists -
SA http://lists.zope.org/mailman/listinfo/zope-announce
SA http://lists.zope.org/mailman/listinfo/zope )




___
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] freebsd file: table is full when starting zope2

2001-02-14 Thread Steve Spicklemire


If you bump maxusers up to 64 (from the default 32) and rebuild
the kernel the messages should go away... it's worked for me. 

-steve
 "RDM" == Zope mailing lists [EMAIL PROTECTED] writes:

RDM On Wed, 14 Feb 2001, Sin Hang Kin wrote:
 When starting Zope2.3 from the freebsd box, the kernel says :
 file: table is full.
 
 The kern.maxfiles is set to 1064, does zope really need that
 many? what number should I need to make zope happy?

RDM I noticed this problem with Zope and FreeBSD a long time ago,
RDM and managed to track it down to zserver or python or a python
RDM module opening every possible socket number separately on
RDM startup (this is from an lsof dump as zserver is starting).
RDM The ones it doesn't use get closed somehow, but it sure was a
RDM weird thing to see.  I've no idea if this is a bug in
RDM zserver/python or a bug in FreeBSD, and since it hasn't been
RDM causing me any real problems (just the message in the log), I
RDM haven't bothered to track it further.  I still see the
RDM messages though, and I'm now running FreeBSD 4.2S and Zope
RDM 2.3.0.

RDM --RDM


RDM ___ Zope-Dev
RDM maillist - [EMAIL PROTECTED]
RDM http://lists.zope.org/mailman/listinfo/zope-dev ** No cross
RDM posts or HTML encoding!  ** (Related lists -
RDM http://lists.zope.org/mailman/listinfo/zope-announce
RDM http://lists.zope.org/mailman/listinfo/zope )


___
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] http headers

2001-02-12 Thread Steve Spicklemire


Another you might consider (though Shane's is great, but 
required Tkinter, which not everybody (me!) has really easy 
accesss to... ) is the more browser based, but less flexible:

http://www.cyberclip.com/webdebug/

-steve

 "SA" == Steve Alexander [EMAIL PROTECTED] writes:

SA Tim McLaughlin wrote:

 Anyone know how I can log or view the http headers that Zope
 sends when it responds to a http request?

SA Take a look at tcpwatch:

SA http://www.zope.org/Members/hathawsh/tcpwatch

SA -- Steve Alexander Software Engineer Cat-Box limited
SA http://www.cat-box.net


SA ___ Zope-Dev
SA maillist - [EMAIL PROTECTED]
SA http://lists.zope.org/mailman/listinfo/zope-dev ** No cross
SA posts or HTML encoding!  ** (Related lists -
SA http://lists.zope.org/mailman/listinfo/zope-announce
SA http://lists.zope.org/mailman/listinfo/zope )


___
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] 2.3 and Products

2001-01-26 Thread Steve Spicklemire


Take a look.. 

http://zope.nipltd.com/public/lists/dev-archive.nsf/ByKey/C0FFC7204901563A

-steve

 "MM" == =?iso-8859-1?Q?Max M=F8ller Rasmussen?= iso-8859-1 writes:

MM From: Chris McDonough [mailto:[EMAIL PROTECTED]]

 This is not true.  The behavior is the same as before... the
 plans to make restart optional were waylaid by complications.
 ;-(

MM Another thing with products. Whenever I do a referesh with the
MM refresh tab, another instance of the product shows up in my
MM "add" dropdown selector. So If I have a "maxms goodstuf"
MM product that i am editing I get a select box like:

MM Dtml Document Dtml Method Folder maxms goodstuf maxms goodstuf
MM maxms goodstuf maxms goodstuf maxms goodstuf maxms goodstuf
MM maxms goodstuf Catalog

MM After a little while.

MM Is there a solution to this?

MM Regards Max M

MM ___ Zope maillist
MM - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope **
MM No cross posts or HTML encoding!  ** (Related lists -
MM http://lists.zope.org/mailman/listinfo/zope-announce
MM http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope-dev] Local roles and security of ZClass instances in Specialists

2001-01-23 Thread Steve Spicklemire


Hi Itai,

   I'm sure there's something clever you could do here with
an attribute provider for you user object that supplied
__roles__ dynamically somehow, but I'd need to think
about that more... one easy way to limit who can
see different stuff is to use a wrapper around
your access methods (e.g., SQL queries) that checks for
security:

e.g., 

WITH [ QUERY ] LookupAttributesAndCheckForPermission(REQUEST) COMPUTE foo, bar, baz

where LookupAttributesAndCheckForPermission get's everything it needs out of
the REQUEST.

It's a crude tool.. but it's simple. When I get some time to think clearly.. 
I'll try to come up with something more general. Hopefully you'll also get
some other suggestions... 

-steve
 "Itai" == Itai Tavor [EMAIL PROTECTED] writes:

Itai Hi,

Itai I'm trying to work out a security strategy for data stored
Itai in Specialists, where specific users need access to specific
Itai data instances.

Itai For example: A Customer object is linked to a Person and
Itai Address objects. The customer needs permission to edit the
Itai her - and only her - Address object. Using the Owner local
Itai role won't work, because customers can be registered by site
Itai managers and customer support people, in which case Owner
Itai won't be the customer.

Itai I can solve this by giving the customer a local role when
Itai creating her Address object:

Itai  Customers.addCustomer(REQUEST): ni =
Itai container.addItem(some_id)
Itai container.Addresses.addAddressFor(ni.id, REQUEST)

Itai  Addresses.addAddressFor(for_id, REQUEST): ni =
Itai container.addItem(some_id) ni.manage_addLocalRole(for_id,
Itai 'EditMyDetails')

Itai But this can be a lot of work - If an Address object can
Itai also be created for a CreditCard object, addCreditCard will
Itai have to both set its own local role, and pass the customer
Itai id on to Address...

Itai But the main problem is that I'm not sure if it will work at
Itai all - can local roles be set for DataSkins that aren't
Itai stored in the ZODB?  From what I can see ZPatterns doesn't
Itai support this, so I'll have to do it
Itai myself. __ac_local_roles__ can't be accessed in a SkinScript
Itai - so will I have to override has_local_roles,
Itai get_local_roles and get_local_roles_for_userid and call them
Itai from the SkinScript? This is getting hairy...

Itai Without local roles, all I can think of is explicitly
Itai checking that the logged in user is the right customer in
Itai all the methods that display and edit the object, which is
Itai very ugly. Plus it would require Address to know a
Itai customer_id even when it actually belongs to a CreditCard,
Itai not a Customer... there goes Demeter. Or I can add a
Itai findUserID to Address, CreditCard and Customer, all of which
Itai pass the request upwards until one is reached that actually
Itai knows the customer. Still ugly.

Itai TIA for Any comments/suggestions.

Itai Itai -- Itai Tavor "Je sautille, donc je suis."  C3Works
Itai [EMAIL PROTECTED] - Kermit the Frog

Itai "If you haven't got your health, you haven't got anything"


Itai ___ Zope-Dev
Itai maillist - [EMAIL PROTECTED]
Itai http://lists.zope.org/mailman/listinfo/zope-dev ** No cross
Itai posts or HTML encoding!  ** (Related lists -
Itai http://lists.zope.org/mailman/listinfo/zope-announce
Itai http://lists.zope.org/mailman/listinfo/zope )






___
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] TCPWatch... and closing sockets..

2001-01-22 Thread Steve Spicklemire


Well proxy_receiver seems to set it's terminator to 'None', which
seems to indicate that the dispatcher should just send it all as it
comes without checking for any special terminator (which is indeed
what appears to be happening!)  The problem is that this dispatcher
code:

  def recv (self, buffer_size):
try:
data = self.socket.recv (buffer_size)
if not data:
# a closed connection is indicated by signaling
# a read condition, and having recv() return 0.
self.handle_close()
return ''
else:
return data

is never called at a time when self.socket.recv() returns ''. I think this
is the normal signal for a closed socket... so if it's never getting an
empty string... does that mean the socket is not closed correctly?
Should ayncore be changed so that handle_close() is called whenever 
close() is called (unless it has already been called in recv)? 
I'm guessing that the OS takes care of any handles that may be left
dangling here... if any.

thanks,
-steve

 "kapil" == ender  [EMAIL PROTECTED] writes:

kapil i'm guessing this has something to do with the default line
kapil terminators that medusa is looking for before it senses
kapil that a data buffer is ready to be processed. it seems like
kapil the url encoded ones request seem to have different line
kapil terminators. you can adjust this the fly by using the
kapil set_terminator() func on the dispatcher. set_terminator can
kapil look for either a set of input chars, or you can adjust the
kapil data buffers to fire off for processing on integer sizes.

kapil hope that helps

kapil kapil


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] TCPWatch... and closing sockets..

2001-01-21 Thread Steve Spicklemire


I'm going to try to make a long story short... and the story isn't even
over... but I'm getting close. One of our clients is a 'multimedia'
company and we're working with a group there that consists mostly
of artists and designers who use tools like photoshop and 
macromedia director. They came to us recently with a project
for which they were *going* to use Macromedia Multiuser Server
but the complexity of their application is significant.. 

long story short... I've sold them on the concept of using Zope as the
'media/personality server' for this application.  They will use
Director (which can post stuff to an URL and can also parse
XML). So.. I'm building a framework that permits them to use their
favorite tools, but I get to use *my* favorite tool too. ;-) The
problem: Director is not a browser. There is no 'view source'. But (I
think to myself) this is a great chance to use tcpwatch, which I've
never used before. It's a little tricky since my favorite client
machine is a Macintosh, and well.. lets just say that Tkinter for the
mac is not perfect... not to mention there is no thread module..  but
I do have a workaround that's useful (since I run Zope on a FreeBSD
server, I just use tcpwatch on FreeBSD and either MI/X, or VirtualPC
with Linux for my X server.. ). I noticed however that when I did a
'POST' the URL encoded arguments were lost. I found that the
proxy_receiver handle_close method was never called.. so that anything
in a 'last line' that didn't end in '\n' was lost. I added the
following patch that shows this... but why is handle_close not called?
I can only guess that the socket is not being properly closed
somehow. I use lib/python/ZPublisher/Client.py to test calls to Zope
and it works fine, but the asyncore/asynchat stuff never calls
handle_close for proxy_receiver.

Anyway... here's the patch: Comments welcome!

*** ./tcpwatch_orig.py Sat Jan 20 16:55:43 2001
--- ./tcpwatch.py   Sun Jan 21 16:52:11 2001
***
*** 130,135 
--- 130,137 
  pos = pos + 1
  else:
  # Last line, may be incomplete.
+ line = "Partial line? " + data[oldpos:] + '\r\n'
+ self.watch_output(line, byClient)
  return data[oldpos:]
  
  def cleanupRefs(self):

take care,
-steve

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] [python] creating variable names by adding 2 strings?

2001-01-21 Thread Steve Spicklemire


Hi Lee,

   You could use a dictionary for this:

vars = {}

while (p!=0):
vars['p'+`p`] = string.replace(component[control], ",", "") 
p=p-1
control=control+1

then 'vars' will contain keys (e.g., 'p1', 'p2' etc.. ) and corresponding values.

If that's totally not what you want.. a little more context would help. 

;-)

-steve

--

Hi there,

I'm creating variables in python but I am having trouble creating them
when they're *named* using other variables. Here's an example;

while (p!=0):
p+`p`= string.replace(component[control], ",", "") 
# e.g. I want 'p1 = string.replace.blah...'
p=p-1
control=control+1

== SyntaxError: can't assign to operator :(

I've tried various things but I cannot find a solution. I've got a nasty
feeling that it's not possible...

If someone could confirm this or hopefully, tell me how to do it I would
be_extremely_grateful.

Thanks,

Lee (crossing his fingers)


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Tools used for programming Zope

2001-01-19 Thread Steve Spicklemire


In it's current released form ZCVSMixin really does help with
a lot of the configuration/process problems in developing 
with Zope. You can still 'grep' for stuff, and it is
possible to perform simple edits in the xml representation
without much fear of actually breaking anything (it's pretty
obvious where the text of a method is stored etc.. ).  However I
have not really found this necessary. We use ZCVSMixin all
the time, and (almost) never touch the filesystem directly.

1) Each developer works in their own Zope, with their
own local 'checkout' of the project (many projects
involve both instantiated Zope objects, and Python Product
source code, all of which are managed in CVS). 

2) When you are 'editing' a Zope object you use 
an editor that knows about FTP (e.g., emacs), WebDAV or
a web browser.

3) You can use the 'normal' CVS process (update, modify, checkin). 

4) You can still do sensible 'diffs' on the xml representation
and get a pretty good idea about what's happening.

5) It's easy to set up a 'test' Zope, and a 'live' Zope each of which
also has access to CVS. Periodically we update the 'test' Zope and let
users bang away at it looking for bugs.  When we're ready for an
update to the live server we checkin our code tag it... (you can still
use the filesystem CVS commands to tag versions recursively!) and then
update the live server (inside a Zope Version) to that tag. When we
save the Zope version we are fully updated. You still need to 'know too 
much' to use this process effectively, but, it is a pretty workable
process, especially for a site that is constantly evolving (are
there sites out there that *don't* constantly evolve?)

It has also turned out that we occasionally need to make a 
*really* simple change on the live server... (there is no
way this could possibly break anything... so I'll just change
it!). As silly as that sounds.. it happens. It's nice to know
that we can simply check that change in.. and know that all
the developers will get it.. even though they are working
on different systems.

There are still a few annoying bugs, and there are several major
issues that need to be addressed:

http://dev.zope.org/Wikis/DevSite/Proposals/SynchronizationMechanismZCVSMixin

I'm hoping to "get some time" soon to address some of these things.
In the mean time... it's probably worth a look.

-steve

 "GG" == Gerald Gutierrez [EMAIL PROTECTED] writes:

GG At 02:37 PM 1/18/2001 -0600, you wrote:

 do an xml export. You can save cvs that to your hearts content.

GG ... but then I'll have to forego readability, edit-ability,
GG etc.

GG Frankly, I'm a little surprised that this isn't a problem for
GG more people, given the drawbacks of having to give up many of
GG the existing tools, having the application server only be able
GG to export in a proprietary format, and being bound to the
GG application server for so many development-related tasks. It's
GG impossible to do a simple grep through the code, for example
GG ...

GG I'm trying to reconcile this, as you might see, because I want
GG to use Zope but am having a hard time making it work for me.

GG Gerald.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] zope, xemacs and efs

2001-01-18 Thread Steve Spicklemire


Hmmm.. I use emacs/ange-ftp all the time with zope... many
versions.. with no trouble. Have you tried that? Since my
client is not 'X' (yet) I don't use xemacs... 

-steve

 "glw" == Geoffrey L Wright [EMAIL PROTECTED] writes:

glw I'd LOVE to be able to use efs with Zope.  Right now I end up
glw cutting and pasting code in and out of browser windows --
glw which just feels kind of unwieldy...

glw Thanks for any help or words of solace...


glw //glw


glw ___ Zope maillist
glw - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope
glw ** No cross posts or HTML encoding!  ** (Related lists -
glw http://lists.zope.org/mailman/listinfo/zope-announce
glw http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Variable sort and multiple sort in dtml-in

2001-01-18 Thread Steve Spicklemire


Hi Loren,

   There is also Zieve:

http://www.zope.org/Members/sspickle/Zieve

Not quite as easy as a 'fixed' dtml-in ...  but it
does work (today). 

-steve

 "Loren" == Loren Stafford [EMAIL PROTECTED] writes:

Loren On 02 July 2000, Adam Karpierz, posted a patch that would
Loren allow an expression for the sort specification for the
Loren dtml-in tag. Did that patch, or something like it, ever
Loren find its way into the Zope core?

Loren I also seem to remember some discussion of sorting on
Loren multiple items (but can't find any trace of it in the
Loren archives). For example, in an employee directory, sort on
Loren employee name within department. Anyone know how?

Loren I'm trying to provide user-specified sorting on the records
Loren I pull from a SQL database. When the user specifies sorting
Loren on Department, I assume he wants the records order by Name
Loren within each department, but I can't see how to do that with
Loren ZSQL or dtml-in.

Loren -- Loren


Loren ___ Zope
Loren maillist - [EMAIL PROTECTED]
Loren http://lists.zope.org/mailman/listinfo/zope ** No cross
Loren posts or HTML encoding!  ** (Related lists -
Loren http://lists.zope.org/mailman/listinfo/zope-announce
Loren http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope-dev] Massive scalability

2001-01-17 Thread Steve Spicklemire


Hi Andy,

   I'm not sure what you mean by 'interface/way', so.. I'm going to 
guess at two possible interpretations.

1) Basically ZPatterns allows you to define classes (DataSkins)
instances of which can optionally be used to view/create/change/delete
external data through methods of the class ( + a little SkinScript ).

If your store your instance data in SQL you can use SQL queries,
masked from the application behind some generic method (e.g.,
getFooIdsWithText( textToFind )") to find the id(s) of the instance(s)
you're after.  You can then get the instance from the ZPatterns
machinery and, once gotten, display it, change it, call it's methods,
and/or delete it. The way these actions on the object interact with
the data in the external database is all defined in 'SkinScript' which is
hidden away as a PlugIn of a Rack deep inside the ZPatterns guts. At
the Zope application level you don't really *know* where/how the data
is stored. Best of all you, or your Product's customers can easily
customize that part *after* your product is plugged into *their*
application, without changing the basic application level logic
and design of your product.

It's the coolest. ;-)

2) To get folks started with moving objects from ZODB to SQL I've
found ZFormulator handy as a tool to get folks quickly up to speed
in how SQL 'works'. 

http://www.zope.org/Members/faassen/ZFormulator

If they already have ZClasses, they can use this to 'automatically' 
generate starting point queries to match their class propertysheets.
Of course... it probably won't be normalized/optimized/etc.. but
it's better than doing it all for them! ;-)

-steve

 "Andy" == Andy McKay [EMAIL PROTECTED] writes:

Andy Does ZPatterns provide a nice interface / way for storing
Andy classes in a RDBMS? I have to say using an RDBMS is not as
Andy transparent as I would like, this may may improve
Andy it. Finally a reason for me to ZPatterns...

Andy -- Andy McKay.


Andy - Original Message - From: "John Eikenberry"
Andy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: "Michael
Andy Bernstein" [EMAIL PROTECTED] Sent: Tuesday, January 16,
Andy 2001 3:22 PM Subject: Re: [Zope-dev] Massive scalability


 Michael Bernstein wrote:
 
  So, again: Has anyone run up against any performance or 
 other limitations regarding large numbers (hundreds of 
 thousands or more) of objects stored within the ZODB either 
 in a BTree Folder or a Rack?
 
 I was looking into the same issues recently, but for a much
 smaller set of data (5ish). In my tests
 ZPatterns/binary-trees scaled well for
Andy storage
 and retrieval. But ZCatalog did not. It was basically useless
 for partial matching searches (taking many minutes for searches
 that retrieved more than 100 matches). I was also concerned
 about the indexing overhead. It doesn't scale well when
 changing/adding many things at a time (we might have bulk
 adds/changes).
 
 I ended up deciding to go with a RDBMS backend for data storage
 with a ZPatterns interface. SkinScripts work so well for this
 that I'm actually glad I switched. It simplified my design and
 implementation immensely.
 
 --
 
 John Eikenberry [[EMAIL PROTECTED] - http://zhar.net]
 __
 "A society that will trade a little liberty for a little order
 will deserve neither and lose both."  --B. Franklin
 
 ___ 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 )
 


Andy ___ Zope-Dev
Andy maillist - [EMAIL PROTECTED]
Andy http://lists.zope.org/mailman/listinfo/zope-dev ** No cross
Andy posts or HTML encoding!  ** (Related lists -
Andy http://lists.zope.org/mailman/listinfo/zope-announce
Andy http://lists.zope.org/mailman/listinfo/zope )



___
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] Calling other frames

2001-01-15 Thread Steve Spicklemire


I think probably Javascript is the 'cleanest' solution in this case,
but depending on the complexity of your UI another non-JS approach is
to make every link target the topmost frome (e.g., target="_top") and
redraw all frames in the frameset on each 'click'. This way you know
that all frames reflect the latest situation, but it can be annoying
to see the whole browser redraw every time you do anything. However, 
if your browser doesn't *do* Javascript (so long as it does do
frames hmm.. how likely is that?) then it would at least work 

-steve

 "Martijn" == Martijn Pieters [EMAIL PROTECTED] writes:

Martijn On Sun, Jan 14, 2001 at 11:16:44PM -0800, Dirksen wrote:
 First of all, I don't think you can achieve that with
 javascript. As far as I know, neither IE nor Netscape allows
 javascript to access DOM objects of other frame page for
 security reasons.

Martijn This restriction only applies when the two frames come
Martijn from different domains. Alll URLs from the same webserver
Martijn can access DOM trees in other frames from the same
Martijn server. This is how Zope updates the left-hand tree in
Martijn the management interface when you add a Folder, for
Martijn instance.

Martijn For an example of updating navigation buttons across
Martijn frames see http://www.tunix.nl/'. Ignore the Dutch, just
Martijn choose an option on the main page, then use the top and
Martijn left navigation buttons to go around a website.  Then use
Martijn your browser's back and forward buttons to see the left
Martijn and top menus follow the current page. Also, when
Martijn clicking on a link in the content pane, the navigation
Martijn menus will update. All JavaScript source comments are in
Martijn english, that's they way I worked.

Martijn -- Martijn Pieters | Software Engineer
Martijn mailto:[EMAIL PROTECTED] | Digital Creations
Martijn http://www.digicool.com/ | Creators of Zope
Martijn http://www.zope.org/
Martijn -

Martijn ___ Zope
Martijn maillist - [EMAIL PROTECTED]
Martijn http://lists.zope.org/mailman/listinfo/zope ** No cross
Martijn posts or HTML encoding!  ** (Related lists -
Martijn http://lists.zope.org/mailman/listinfo/zope-announce
Martijn http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] PoPy Installation. Where's the BEEF?

2001-01-11 Thread Steve Spicklemire


Did you move this Zope from it's original location in  /usr/local/zope?
I'm guessing you did.. and those paths are in the .pyc files.

try:

find /usr/local/EcoZope -name "*.pyc" -delete 

then (optionally) rerun w(o?)_pgci.py which will (among other things)
rebuild the .pyc files. If you don't, Zope will just be slower for a while
is it rebuilds the pyc files as it imports them (mostly at startup I 
would guess).

-steve

 "Eric" == Eric Walstad [EMAIL PROTECTED] writes:

Eric AAKK!  I just noticed something...  -8-- Start Snip
Eric --8- ZPoPyDA Import Traceback Traceback (innermost
Eric last): File "/usr/local/Zope/lib/python/OFS/Application.py",
Eric line 397, in import_products product=__import__(pname,
Eric global_dict, global_dict, silly) File
Eric "/usr/local/zope/lib/python/Products/ZPoPyDA/__init__.py",
Eric line 32, in ?  File
Eric "/usr/local/zope/lib/python/Products/ZPoPyDA/DA.py", line
Eric 35, in ?  File
Eric "/usr/local/zope/lib/python/Products/ZPoPyDA/PoPy_db.py",
Eric line 35, in ?  The PoPy module is not installed -8--
Eric End Snip --8- Notice the paths in the traceback.

Eric I have one copy of Zope (no PostgreSQl support) in:
Eric /usr/local/Zope

Eric And another copy that will need to connect to PostgreSQL is
Eric in: /usr/local/EcoZope

Eric and ZPoPyDA is in:
Eric /usr/local/EcoZope/lib/python/Products/ZPoPyDA/

Eric The traceback is displaying wrong paths.  I searched the
Eric ZPoPyDA python source for hard coded paths but didn't find
Eric any.  Is there an environment variable that sets this?

Eric Thanks for any help...  Eric.  

Eric Eric Walstad [EMAIL PROTECTED] 


Eric ___ Zope
Eric maillist - [EMAIL PROTECTED]
Eric http://lists.zope.org/mailman/listinfo/zope ** No cross
Eric posts or HTML encoding!  ** (Related lists -
Eric http://lists.zope.org/mailman/listinfo/zope-announce
Eric http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] with a variable

2001-01-11 Thread Steve Spicklemire


How about this:

dtml-call "REQUEST.set('userid', 979226100)"
dtml-with "_[userid]"
dtml-var attribute
/dtml-with

or

dtml-call "REQUEST.set('userid', 979226100)"
dtml-with "_.getitem(userid)"
dtml-var attribute
/dtml-with

-steve

 
 Hi,
 
 a small problem!,
 
 This works:
 dtml-with 979226100
 dtml-var attribute
 /dtml-with
 
 This doesn't:
 dtml-call "REQUEST.set('userid', 979226100)"
 dtml-with "_.getitem('userid')"
 dtml-var attribute
 /dtml-with
 
 Nor this:
 dtml-call "REQUEST.set('userid', 979226100)"
 dtml-with "userid"
 dtml-var attribute
 /dtml-with
 
 Nor this:
 dtml-call "REQUEST.set('userid', 979226100)"
 dtml-with userid
 dtml-var attribute
 /dtml-with
 
 What I want to do is have a varible passed to the page which says what
 zclass instance to get the properties of.
 
 any help appreciated.
 
 josh on
 
 
 ===
 write: [EMAIL PROTECTED]
 read: www.futurefarmers.com
 read: www.crd.rca.ac.co.uk/~josh
 interrupt (i love it): (415) 552 2124
 =
 
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists - 
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )
 

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: EMarket 0.1.04b1

2001-01-08 Thread Steve Spicklemire


Sorry.. it's my fault for not providing better docs.. sadly
it's not been something I've had time for... esp since all the 
ZPatterns changes were added.

1) Create ZClasses for your MarketItems, Baskets, BasketItems and Shoppers
  (be sure to subclass from ZPatterns:DataSkin)

2) In the Racks for each of these Specialists set the storage to the
   appropriate ZClass.

3) There is a very simple marketItem management interface in the
   marketItems specialist that you should modify to suit your taste.
   It should be enough to get you going.

When I get some time... dunno when... I'll try to make a more complete
example for folks.

-steve
 "James" == James Sintz [EMAIL PROTECTED] writes:

James Perhaps I'm missing something fundamental, but I can't seem
James to figure out how to add products to EMarket 0.1.04b1
James running on Zope 2.2.2

James Everything installed just fine and I can add an EMarket
James object, but I don't see where, or how I go about adding
James things to sell. I don't care about the auction features, I
James just want to sell a handful of products on my site.

James When I go to the MarketItems folder, and try submitting an
James item using the ShopperMarketItemAddForm it returns a screen
James saying "You must be validated for submission first...". I
James am logged in as a manager. If I log out and then register a
James new user and then try I'm told I don't have permission to
James add a new MarketItem. What gives?  The read me doesn't
James provide much insight on what I am doing wrong. Are there
James zClasses I need to add or templates I need to create before
James the thing will work?  Thanks!!  Jamey


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Re: EMarket 0.1.04b1

2001-01-08 Thread Steve Spicklemire


Hi Jamey,

   Sorry.. you're right. I haven't used 0.1.x in quite a while.

Have you tried just using the administrative interface 
to add a MarketItem in the marketItems folder? 

-steve

 "James" == James Sintz [EMAIL PROTECTED] writes:

James Do I need to have ZPatterns installed to use Emarket
James 0.1.04b1? I thought Zpatterns was only needed for EMarket
James 0.2.

James Jamey


James -Original Message----- From: Steve Spicklemire To:
James [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
James Sent: 1/8/2001 4:25 PM Subject: [Zope] Re: EMarket 0.1.04b1


James Sorry.. it's my fault for not providing better docs.. sadly
James it's not been something I've had time for... esp since all
James the ZPatterns changes were added.

James 1) Create ZClasses for your MarketItems, Baskets,
James BasketItems and Shoppers (be sure to subclass from
James ZPatterns:DataSkin)

James 2) In the Racks for each of these Specialists set the
James storage to the appropriate ZClass.

James 3) There is a very simple marketItem management interface
James in the marketItems specialist that you should modify to
James suit your taste.  It should be enough to get you going.

James When I get some time... dunno when... I'll try to make a
James more complete example for folks.

James -steve
 "James" == James Sintz [EMAIL PROTECTED] writes:

James Perhaps I'm missing something fundamental, but I can't seem
James to figure out how to add products to EMarket 0.1.04b1
James running on Zope 2.2.2

James Everything installed just fine and I can add an EMarket
James object, but I don't see where, or how I go about adding
James things to sell. I don't care about the auction features, I
James just want to sell a handful of products on my site.

James When I go to the MarketItems folder, and try submitting an
James item using the ShopperMarketItemAddForm it returns a screen
James saying "You must be validated for submission first...". I
James am logged in as a manager. If I log out and then register a
James new user and then try I'm told I don't have permission to
James add a new MarketItem. What gives?  The read me doesn't
James provide much insight on what I am doing wrong. Are there
James zClasses I need to add or templates I need to create before
James the thing will work?  Thanks!!  Jamey


James ___ Zope
James maillist - [EMAIL PROTECTED]
James http://lists.zope.org/mailman/listinfo/zope ** No cross
James posts or HTML encoding!  ** (Related lists -
James http://lists.zope.org/mailman/listinfo/zope-announce
James http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] How to call ancestral method in ZClass method?

2001-01-07 Thread Steve Spicklemire


Hi Dirksen,

Are you deleting a Rack? or an instance of a DataSkin that
is managed by a Rack? 

-steve

 "Dirksen" == Dirksen  [EMAIL PROTECTED] writes:

Dirksen Hi Steve,

Dirksen Well, if my rack object is stored persistently, I guess
Dirksen no skinscript would get fired, am I right? In that case,
Dirksen I need to override manage_delete, and call it in this
Dirksen statement:

Dirksen dtml-call "PortalMember.manage_delete()"

Dirksen Zope complains NameError of PortalMember. If I changed
Dirksen to:

Dirksen dtml-call "_ZClass_for_DataSkin.manage_delete()"

Dirksen Zope refuses the upload of the dtml method all together!

Dirksen Any clues?

Dirksen Dirksen


    Dirksen --- Steve Spicklemire [EMAIL PROTECTED] wrote:
  Hi Dirksen,
 
 In python you would normally do:
 
 super_class_object.manage_delete(self)
 
 but it might be easier/better in the case of a DataSkin to use
 a SkinScript 'WHEN OBJECT DELETED xxx '.
 
 -steve
 
  "Dirksen" == Dirksen [EMAIL PROTECTED] writes:
 
Dirksen I have a ZClass 'stuff' which is a subclass of
Dirksen DataSkin. 'stuff' overrides 'manage_delete' method, so as
Dirksen to do some extra clean-up jobs. After that, it will call
Dirksen its ancestor's 'manage_delete' method to wipe itself
Dirksen off. In java, you can do this by calling
Dirksen 'super.manage_delete()', but how to do it in zope?

Dirksen Dirksen

Dirksen __ Do You
Dirksen Yahoo!?  Yahoo! Photos - Share your holiday photos
Dirksen online!  http://photos.yahoo.com/

Dirksen ___ Zope
Dirksen maillist - [EMAIL PROTECTED]
Dirksen http://lists.zope.org/mailman/listinfo/zope ** No cross
Dirksen posts or HTML encoding!  ** (Related lists -
Dirksen http://lists.zope.org/mailman/listinfo/zope-announce
Dirksen http://lists.zope.org/mailman/listinfo/zope-dev )



Dirksen __ Do You
Dirksen Yahoo!?  Yahoo! Photos - Share your holiday photos
Dirksen online!  http://photos.yahoo.com/


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope-dev] ZPatterns: SAVING doesn't tolerate missing attributes

2001-01-06 Thread Steve Spicklemire


Hi Steve,

   Could you let some other value represent no car? (e.g., _.None?).

untested... 

WITH CompanyCars.getCar(self.car_id) or NOT_FOUND COMPUTE
   car=RESULT,
   car_registration=registration
OTHERWISE LET
   car=_.None
   car_registration="no car"

WHEN OBJECT CHANGED CALL
   HAS_CHANGED('car_id') and
   (self.car_id and CompanyCars.getItem(self.car_id).decommission(),
ORIGINAL['car_id'] and (OLD['car'] and OLD['car'].commission()))
SAVING car

Would that work?

-steve

 "SA" == Steve Alexander [EMAIL PROTECTED] writes:

SA In SkinScript such as

SAWHEN eventspec CALL expression SAVING mementolist

SA if any of the mementos in mementolist are not found, the
SA script raises a KeyError.


___
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] SQLs from Python strings

2001-01-06 Thread Steve Spicklemire


Hi Lee,

   Two points: 1) DTML works fine in ZSQL methods and 2) Due to (1)
you can use dtml-var xxx and pull in anything from Zope that you
like (but be careful... since someone might be able to pull in
something you weren't thinking of when you set up the method:

e.g., if you have a method called foo, with the line:

dtml-var xxx

someone might try:

http://yourserver/foo?xxx=drop%20table%20valueableData

and your valuable data would be gone! Make sure that
only folks with the correct privs, or methods with the
correct proxy can call your method.

-steve

 "Lee" == Lee  [EMAIL PROTECTED] writes:

Lee On first impressions this may look like a homework assignment
Lee question but I can assure you it isn't! I'm having difficulty
Lee trying to explain this (hence the strange subject line ;-)
Lee but I hope someone can offer me some advice...

Lee I have four attributes (A, B, C, D) and each is an integer
Lee say, between 0 and 9.

Lee I need a method to create a table with the following columns:

Lee Name Age [if A=3] then A1, A2, A3 [if B=1] then B1

Lee i.e. if A=3 and B=1 and C  D =0 then 6 columns will be
Lee created.

Lee I already have the code (well, the logic) to do this but what
Lee is the best way to do it. ZSQL methods can't handle such
Lee logic, right?  I was thinking maybe passing the parameters
Lee into a python method to build a "CREATE TABLE..."
Lee string... but can this be used to actually execute the query?

Lee I don't know if I have explained this well enough.

Lee Here's the logic (no particular language and A,B,C,D =
Lee P,T,A,B)

Lee int p = PRACTICALS; int t = TUTORIALS; int a = ASSIGNMENTS;
Lee int b = BONUS;

Lee string classAndCode = CLASSCODE;

Lee String createDB = "CREATE TABLE " + classAndCode + " ( "

Lee while (p != 0) { String createDB = create DB + "p" + p +
Lee "integer, " // e.g. p0, p1, p2, etc.  p = p-1; }

Lee while (t != 0) { String createDB = create DB + "t" + t +
Lee "varchar, " t = t-1; }

Lee ... etc

Lee Okay, say I have a python method, which returns an String (an
Lee SQL CREATE TABLE statement). How could I execute this?

Lee Thanks very much in advance.

Lee Lee

Lee PS: Alex, I managed to get the COUNT var to work. The
Lee solution was simply a good night's sleep and a large mug of
Lee coffee in the morning.  Cheers :)

Lee -- Lee Reilly mailto:[EMAIL PROTECTED]
Lee http://www.footkick.co.uk/lee




Lee ___ Zope maillist
Lee - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope
Lee ** No cross posts or HTML encoding!  ** (Related lists -
Lee http://lists.zope.org/mailman/listinfo/zope-announce
Lee http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope-dev] Re: ZPatterns: __getitem__ on a DataSkin instance

2001-01-05 Thread Steve Spicklemire


Hi Steve,

   Hmm.. is the 'id' of your PythonScript also getattr?

thanks,
-steve

 "Steve" == Steve Alexander [EMAIL PROTECTED] writes:

Steve Steve Alexander wrote:

 Let's say I have a DataSkin-derived ZClass that has the
 attribute "forename" (in a dataskin attribute propertysheet).
 
 If I get an instance of this ZClass from the ZODB (set up to
 use a Folder w/ customizer suppport), I can refer to the
 "forename" attribute using dtml-var "this()['forename']".
 
 However, if I get an instance of the same class from a
 Specialist, dtml-var "this()['forename']" gives me
 
 Error Type: AttributeError Error Value: __getitem__
 
 Any idea why there's the difference?
 
 Can the latter case be fixed?

Steve A workaround, using the ever-flexible skinscript:

Steve I've defined __getitem__ through skinscript and a
Steve PythonScript.

Steve SkinScript: WITH SELF COMPUTE __getitem__=getattr

Steve PythonScript: parameter list: index

Stevereturn getattr(index)


Steve -- Steve Alexander Software Engineer Cat-Box limited
Steve http://www.cat-box.net



Steve ___ Zope-Dev
Steve maillist - [EMAIL PROTECTED]
Steve http://lists.zope.org/mailman/listinfo/zope-dev ** No cross
Steve posts or HTML encoding!  ** (Related lists -
Steve http://lists.zope.org/mailman/listinfo/zope-announce
Steve http://lists.zope.org/mailman/listinfo/zope )


___
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] How to call ancestral method in ZClass method?

2001-01-05 Thread Steve Spicklemire


Hi Dirksen,

   In python you would normally do:

  super_class_object.manage_delete(self)

   but it might be easier/better in the case of a DataSkin 
to use a SkinScript 'WHEN OBJECT DELETED xxx  '.

-steve

 "Dirksen" == Dirksen  [EMAIL PROTECTED] writes:

Dirksen I have a ZClass 'stuff' which is a subclass of
Dirksen DataSkin. 'stuff' overrides 'manage_delete' method, so as
Dirksen to do some extra clean-up jobs. After that, it will call
Dirksen its ancestor's 'manage_delete' method to wipe itself
Dirksen off. In java, you can do this by calling
Dirksen 'super.manage_delete()', but how to do it in zope?

Dirksen Dirksen

Dirksen __ Do You
Dirksen Yahoo!?  Yahoo! Photos - Share your holiday photos
Dirksen online!  http://photos.yahoo.com/

Dirksen ___ Zope
Dirksen maillist - [EMAIL PROTECTED]
Dirksen http://lists.zope.org/mailman/listinfo/zope ** No cross
Dirksen posts or HTML encoding!  ** (Related lists -
Dirksen http://lists.zope.org/mailman/listinfo/zope-announce
Dirksen http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope-dev] Objects with multiple parents and storage flexibility, ZPatterns?

2001-01-04 Thread Steve Spicklemire


Hi Chris,

 "Chris" == Chris Withers [EMAIL PROTECTED] writes:


Chris Steve Spicklemire wrote:
 I think that if you make your DataSkins folderish it will be
 hard to make the storage anything other than ZODB.

Chris Well, I don't mind the 'skins' being stored in the ZODB,
Chris but, as Steve A mentioned, I _would_ like stuff created in
Chris the RDBMS to 'magically appear' in the Zope side of
Chris things. I guess that means FwCS and folder-subclassing
Chris DataSkins are a no-no?

No... I don't think so! If you don't mind keeping stuff in ZODB
then you *could* have a traversal interface that made stuff 'appear'
wherever you want it to, though its persistent storage would 'really' 
be in a Rack or FwCS.

 Let's say your objects have an attribute that defines them in
 the context of their parent (e.g., dataskin2 in your example
 URL),

Chris their id in Zope parlance, right?

Hmm. not really...  the Zope 'id' is used by the Rack to keep track
of all the objects of a single type. If all your 'X's are kept in one
Rack, they all need a unique 'id'. The idea context_id is an id-like
attribute that 'plays the role of id' in the context of a particular
parent. It's probably a bad name... but all I could think of in 5
minutes... 

 let's call it 'context_id'. You may have six objects with the
 same context_id, but they would all have different parents.

Chris They may each have mutliple parents too ;-) The point for
Chris me is that the id (context_id in your example) is unique in
Chris terms of _only_ the following constraint: No parent may
Chris have more than one child with the same id.  This is
Chris actually how the ZODB works except that it objects in the
Chris ZODB may only have one parent (well, at least ZODBs managed
Chris with Zope ;-)

Wow... multiple parents, multiple children.. it's almost incestuous!
So long as you can write queries for 'find parents for child x' and
'find children for parent y' it shouldn't matter. If not you'll need
to keep references to parents/childred stored in the objects and that
can be bothersome, but possible.

 Now.. you could implement a search interface that finds an
 object in context.
 
 GetObjectInContextOfParent( context_id, parent_id )

Chris might be better if it resolved a path into an object, like
Chris Zope does, hence my keenness to see if there isn't a simple
Chris way I can make Zope and Zpatterns do the bulk of the work,
Chris just with the tweaks I need...

I'm not sure how the path will help you at this point... but if you need
it you can always ask Zope for it once traversal is complete.

 Now for the traversal interface:
 
 def __bobo_traverse__(self, REQUEST, name): ob = getattr(self,
 name, _marker) if ob is _marker: ob =
 self.GetObjectInContextOfParent( context_id = name, parent_id =
 self.id) if ob is not None: return ob raise 'NotFound' return
 ob

Chris looks good...

 Totally untested of course. ;-) Anyway the idea would be to
 *not* use folderish DataSkins, but to build a hierarchy out of
 them that could be traversed.

Chris Hurm... I'd love them to have a UI identical to normal Zope
Chris folders/objectmanagers, though, with properties, a security
Chris tab, and, in a dream world, the ability to drop normal DTML
Chris methods, python Scripts and the like into the foldersish
Chris objects.

Chris Is this asking for too much? ;-)

You can never *ask* for too much. ;-) 

Seriously though... for this you'll probably need to store the objects
persistently in the Rack(s), though you could farm some of their
attributes out to other data storage systems with SkinScript. Nothing
will prevent you from making your DataSkins inherit from ObjectManager
or Folder, but you won't be able to completely 'virtualize' them.  The
only way I *think* you could make this work with completely virtual
data-skins is to create 'sister' classes to everything you wanted to
add (e.g. 'SkinDTML Method' and 'SkinPython Script' which would be new
classes that inherit from DataSkin *and* the class you want to emulate
(and probably yet another class that hanldles the interconnection glue
parents/context and all that). Then you'd need to add whatever
attribute providers were necessary to keep all the attributes of the
original classes (e.g., DTML Method) in your external storage. But it
sounds like you just want to keep 'some' of the associated data
in the external source... so I don't think any of that will be
necessary.

good luck!
-steve

Chris Chris



___
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] Deleting Connection that hangs Zope

2001-01-04 Thread Steve Spicklemire


Hi Jerry,

   You could remove the adaptor Product from Zope the Zope Products
folder and restart, the object will be broken, but deletable, then
restore the Product and restart Zope. 

-steve
 "Spicklemire," == Spicklemire, Jerry [EMAIL PROTECTED] writes:

Spicklemire, Hi Zope Fans,

Spicklemire, Has anyone found a good way to delete a Database
Spicklemire, Connection that hangs Zope at startup? The
Spicklemire, connection seems to be waiting "forever", and so
Spicklemire, there is no access to the Zope interface, so of
Spicklemire, course I can't delete, or disable the offending
Spicklemire, object.

Spicklemire, If there were just a way to set it to not connect
Spicklemire, immediately, prior to startup, that should be
Spicklemire, sufficient. The general question is, "How do you
Spicklemire, access a Zope Object, without running Zope?"

Spicklemire, BTW, I take back everything I said about RDBMS
Spicklemire, Storages being superfluous .  . .

Spicklemire, Thanks, Jerry S.

Spicklemire, ___ Zope
Spicklemire, maillist - [EMAIL PROTECTED]
Spicklemire, http://lists.zope.org/mailman/listinfo/zope ** No
Spicklemire, cross posts or HTML encoding!  ** (Related lists -
Spicklemire, http://lists.zope.org/mailman/listinfo/zope-announce
Spicklemire, http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope-dev] Objects with multiple parents and storage flexibility, ZPatterns?

2001-01-03 Thread Steve Spicklemire


Hi Chris,

Random thoughts follow. ;-)

   I think that if you make your DataSkins folderish it will be hard
to make the storage anything other than ZODB.  However, Steve
Alexander posted a neat trick the other day where __bobo_traverse__ is
supplied by an attribute provider. You could use this to make your
DataSkins traversable. Let's say your objects have an attribute that
defines them in the context of their parent (e.g., dataskin2 in your
example URL), let's call it 'context_id'. You may have six objects
with the same context_id, but they would all have different parents.
Now.. you could implement a search interface that finds an object
in context.  

GetObjectInContextOfParent( context_id, parent_id )

Each object must also (of course) have a parent_id, unless it's
a root level object. In SQL this might be:

select * from objectXs where parent_id = 'dataskin1_id' and context_id = 'dataskin2'

or it could be a catlog search, if you're in ZODB. 


Now for the traversal interface:

def __bobo_traverse__(self, REQUEST, name):
ob = getattr(self, name, _marker)
if ob is _marker:
ob = self.GetObjectInContextOfParent( context_id = name, parent_id = 
self.id)
if ob is not None:
return ob
raise 'NotFound'
return ob

Totally untested of course. ;-) Anyway the idea would be to *not* use folderish
DataSkins, but to build a hierarchy out of them that could be traversed.

-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 example update....

2001-01-01 Thread Steve Spicklemire


Hi Itai,

 "Itai" == Itai Tavor [EMAIL PROTECTED] writes:
Itai Steve Spicklemire wrote:

 Hi Folks,
 
 The Dumb ZPatterns example is updated. Now there is some more
 blah blah blah

Itai Nice work, Steve.

Thanks! 

Itai Removing id lists looks good. I started building objects
Itai using getXForY(y_id), but the last one I made used an id
Itai list following the Dumb Example. I've just changed it to use
Itai getXForY, and it's much cleaner, plus it makes adding X from
Itai Y/editInstanceForm easier.

Yup.. this is working nicely for me. 

Itai I like the idea of naming all UI methods with '_html' - now,
Itai if you find yourself referencing a method which doesn't end
Itai in '_html' in your html code, you know you need to add an
Itai interface method. I just need to decide if I like it enough
Itai to change all my existing code...

Right... I was on the lookout for something natural, and sorta
obvious. I liked the fact that there are already examples of 
'standard' interface methods that have '_html', so I wouldn't
have to change *them*... sometimes laziness can be inspiring. ;-)

Itai Some thoughts about the broken links handling problem: If an
Itai object depends on the existence of another (for example, if
Itai you wanted a ToDo to be tightly linked to a Deliverable)
Itai then it should be deleted when the Deliverable is deleted,
Itai right? You'd have WHEN OBJECT DELETED CALL
Itai ToDos.deleteInstances(myToDoIDs) in the Deliverable
Itai SkinScript, and you would never have ToDos floating around
Itai without a Deliverable. As for the Deliverable changing and
Itai invalidating the link, I think it would be solved if you
Itai used immutable ids for all objects, and stored the
Itai Deliverable title in a separate property. In case of weaker
Itai links, such as between ToDo and Doer, I guess it should be
Itai ToDo's responsibility to return None if the Doer referenced
Itai by doerID doesn't exist - treating it the same way as the
Itai case where no doer has been assigned. 

Yes.. I like this.

Itai Maybe with this
Itai SkinScript: WITH Doers.getItem(self.doerID) CALCULATE
Itai self.doerID=RESULT.id or '' ?  But I'm not really sure about
Itai this...

Ahh.. I think my brain just imploded in a recursive death spiral,
but I get intent of the idea. This would work I think:

WITH Doers.getItem(self.doerID) COMPUTE self.myDoer=RESULT or 
Doers.getItem('doNothing')

where there is a default 'doer' named 'doNothing' in one of the Doers
Racks.  This guy would 'fill in' for the ToDo's doer when no 'real'
doer can be found... I like that. ;-)

Itai I think you've managed very well to stay on the right side
Itai of the line in the sand... the problem is that complex real
Itai world applications have a lot of stuff on the other side of
Itai the line, and the challenge is to pull that stuff over the
Itai line. My personal problem is figuring out if the stuff I
Itai have on the wrong side of the line is necessitated by the
Itai complexity of the application, or if I'm just making things
Itai unnecessarily complicated...

Thanks... don't want to mix metaphors, but I'm fearing that the line
in the sand may be on a slippery slope ;-). Seriously though. It would
be really easy to make this 'dumb' example so complex that a beginner
in ZPatterns couldn't make it through without brain damage but never
fear.. I've already squandered all my free time for the next three
months on this... so it will very likely stay stuck where it is for
some time now... I hope that some ZPatterns beginners find it useful
as a starting place.

take care,
-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] How to make two racks work under one specialist?

2000-12-29 Thread Steve Spicklemire


Hi Dirksen,

   I think the problem you are having has to do with using 'getItem'.

From the SkinScriptSyntax Wiki page:

"If the RESULT is NOT_FOUND, the search for the attribute value falls
through to the next declaration (or attribute provider if the SkinScript
is finished). If there is an OTHERWISE LET clause, the assignments given
there are computed and cached for the remainder of the (sub)transaction..."

This is meant to work automatically for "WITH QUERY ... COMPUTE" scripts,
but in your case the RESULT was _.None, so the test for NOT_FOUND
didn't work. I think you could in principle set up a chain of 
attribute providers:

WITH Deliverables.getItem(self.id) COMPUTE theStandInObject=RESULT or NOT_FOUND

then

WITH self.theStandInObject COMPUTE name OTHERWISE_LET name='not availble'

so that if RESULT is _.None from Deliverables.getItem, then the
'StandIn' will be NOT_FOUND and the COMPUTE will fall through to
the 'OTHERWISE LET' clause. However I don't think this works well when
the existance of the virtual object in the Rack depends on 'theStandInObject'
being found if theStandInObject is NOT_FOUND then the Rack returns
_.None and you're out of luck. Here's a thought...  what if you put a 
'dummy' object somewhere accessable and did this:

WITH Deliverables.getItem(self.id) COMPUTE theStandInObject=RESULT or theDummyObject

then you could set all the attributes of theDummyObject to be whatever you
wanted  and you would never get a RESULT of NOT_FOUND.

-steve

 "Dirksen" == Dirksen  [EMAIL PROTECTED] writes:

Dirksen Hi Steve,

Dirksen It works! Thank you.

Dirksen Still there's a couple of things to be cleared. What's
Dirksen the use of 'otherwise' clause? And is it true that the
Dirksen 1st 'with' clause fails, the whole skinscript process
Dirksen fails (so one 'with' clause is all one skinscript can put
Dirksen up with)?

Dirksen Dirksen



Dirksen __ Do You
Dirksen Yahoo!?  Yahoo! Photos - Share your holiday photos
Dirksen online!  http://photos.yahoo.com/







___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope-dev] ZPatterns example update....

2000-12-28 Thread Steve Spicklemire



Hi Folks,

   The Dumb ZPatterns example is updated. Now there is some more
realistic object referencing going on, borrowing of code snippets
between Specialists and suchlike. There is also more in the way of
reasonable documentation, though everything is in flux, and it still
doesn't resemble a truly completed product. I just feel the need to
get things finished enough that I can stop thinking about them for a
while. ;-) In particular there the ToDos now hold references to Doer
and Deliverable, and no 'lists' are maintained. One thing I need to do
is to have these references automatically 'fixed' when a 'referred to'
entity is removed or modified in such a way that the link should be
broken that's for the next version. If I'm not careful.. it won't
be a 'simple' example anymore. There's got to be a line here somewhere
(in the sand?).

take care,
-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 question

2000-12-28 Thread Steve Spicklemire


Hi Christian,

Well, nobody else answered that I saw... so I'll take a crack
at your questions 

 "CS" == Christian Scholz [EMAIL PROTECTED] writes:

CS Hi there!

CS Finally I managed to get a basic understanding of how to do
CS things with ZPatterns ;-) So seems quite cool :) (and
CS hopefully I find some time to write some basic howto about it)

CS But I have some little questions:

CS 1. Is it possible to retrieve the set of known IDs from a
CS specialist?  Or would I need to add my own method to it which
CS does this (and change it accordingly if I switch to another
CS storage method)?

If you store persistently you can use the Rack's method:

"defaultRack.getPersistentItemIDs()"

but a couple of notes: 1) this returns a BTree object, not a simple
list, so you can't iterate through it in DTML. You'll need to copy
it to a simple list for that.. and 2) If you change to a different
storage you'll need to create your own method (ZSQL Method?). What I've
found is that if you have a large number of objects you'll either want
to query a Catalog, or an SQL database to get Ids that match some criteria
that limit the number of hits to something that makes sense to display 
in a browser.

CS 2. Is it planned to provide something like a virtual folder
CS which acts like a normal object manager but is controlled via
CS ZPatterns (so actually something like Folder with Customizer
CS Support just without the "anchor" in ZODB.  (would also
CS require some mechanism asked for in 1.)

Hmmm... I'm not sure what you're after here. Why not just use
a Specialist? In what sense do you want it to be virtual?
(Are you looking for a dynamic traversal interface that 
would allow you to map URLs to objects that are managed by
ZPatterns? Can you give an example?)

CS 3. Is it possible to use ZPatterns also without some exta
CS ZClass defined in a Product? At least if I don't need methods
CS for my objects but simple want to define the attribute they
CS know.  Would be nice as I could then hold everything together
CS in one place (the specialist that is) without requiring to
CS install something also in the Products folder of the Control
CS Panel.

I believe you need to either create a Python subclass, or a ZClass
subclass of DataSkin. "Raw" DataSkins don't have the right permissions
to allow for TTW access. If you're creating a 'product' anyway... just
make a 'dummy' class that you can use for storage.

CS That's it for now, I will keep experimenting then.. :)

Good Luck!
-steve

CS cheers, Christian

CS -- Christian Scholz MrTopf@IRC COM.lounge
CS http://comlounge.net/ communication  design [EMAIL PROTECTED]

CS ___ Zope-Dev
CS maillist - [EMAIL PROTECTED]
CS http://lists.zope.org/mailman/listinfo/zope-dev ** No cross
CS posts or HTML encoding!  ** (Related lists -
CS http://lists.zope.org/mailman/listinfo/zope-announce
CS http://lists.zope.org/mailman/listinfo/zope )


___
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] How to make two racks work under one specialist?

2000-12-28 Thread Steve Spicklemire


Hi Dirksen..

try this:

WITH Deliverables.getItem(self.id) COMPUTE name=((RESULT is _.None) and 'none 
available') or RESULT.name

What are you using as the 'load by accessing attribute' attribute?

-steve


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] [BUG] calling a constructor crashes Zope

2000-12-25 Thread Steve Spicklemire


Hi Andreas,

   You might try this: Start Zope in debug mode (./start -D ). Then in your __init__...

class AJFile:
  def __init__(self):
 import pdb
 pdb.set_trace()
 self.d = {}


Zope will stop in the debugger. Step through with the debugger and see where things are
going south

-steve

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] [BUG] calling a constructor crashes Zope

2000-12-25 Thread Steve Spicklemire


Hi Andreas,

   I would be really surprised if this were a python problem. 
Are you using any other extensions with your product? Can you
post a more complete set of code that shows how this constructor
is really called? It sounds like the heap is getting corrupted
somehow, maybe a bad Py_DECREF?

thanks,
-steve

 "Andreas" == Andreas Jung [EMAIL PROTECTED] writes:

Andreas On Mon, Dec 25, 2000 at 11:18:23AM -0500, Steve
Andreas Spicklemire wrote:
  Hi Andreas,
 
 You might try this: Start Zope in debug mode (./start -D
 ). Then in your __init__...
 
 class AJFile: def __init__(self): import pdb pdb.set_trace()
 self.d = {}
 
 
 Zope will stop in the debugger. Step through with the debugger
 and see where things are going south

Andreas It is a problem of Python 1.5.2. It seems to crash
Andreas somewhere in glibc (malloc.c) when called from
Andreas PyTuple_New(). I also reported this bug on the bug list
Andreas for Python (#126790).

Andreas Andreas

 



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope-dev] Re: ZPatterns, ObjectDomain, UML and all that.....

2000-12-24 Thread Steve Spicklemire


Hi Itai,

   Good idea! I'll try to add this to the example.

thanks!
-steve

Itai P.S. I've been struggling with a problem that might get
Itai cleared up if you added it to the example:

Itai Say you want to allow a user to add a ToDo from the
Itai Deliverable screen (in addition to the existing menu for
Itai selecting existing ToDos). You could either place a 'create
Itai ToDo' form right there, using a UI snippet from ToDos, or
Itai link to ToDos.addToDoForm. The problem is how to get the id
Itai of the new ToDo into the deliverable. If you didn't store
Itai todo_ids in Deliverable, instead calling
Itai ToDos.getToDosForDeliverable(), there would be no
Itai problem. Otherwise, you'd need a addToDoInterface in
Itai Deliverable, which will call ToDos.addToDo, then add the new
Itai ToDo id to todo_ids. Or, as a third option, you could pass a
Itai method to ToDos.addToDo, and get it to call this method and
Itai give it the new id.

Itai What do you think? Want to tackle this in the example?

Itai Itai -- Itai Tavor "Je sautille, donc je suis."  C3Works
Itai [EMAIL PROTECTED] - Kermit the Frog

Itai "If you haven't got your health, you haven't got anything"


___
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] Reality check PYZOMA = python / zope for Mac ?

2000-12-24 Thread Steve Spicklemire


Hi Jason,

   As far as I know there are only two ways to run Zope on MacOS7/8/9. 

1) run Virtual PC and use the Windows version.

2) run Virtual PC and use the Linux version.

sorry.
-steve

 "Jason" == Jason Cunliffe [EMAIL PROTECTED] writes:

Jason Steve

Jason Thanks very much for this encouraging news.  Indeed if it
Jason runs well, Zope could be important enough app for for soem
Jason people to upgrade to MacOSX.

Jason If one needs to install Zope __now__ on non-MacOSX
Jason machines, what is the story?

Jason cheers - Jason
Jason ___
Jason Jason CUNLIFFE = NOMADICS['Interactive Art and Technology']


Jason Steve Spicklemire [EMAIL PROTECTED] wrote:
 Have you seen: http://www.zope.org/Members/sspickle/MacOSXBHFS
 
 Zope-2.3a1 runs with Python-1.5.2. I've run Zope-2.2.x on
 MacOSX and it runs great. At some point someone with time, or a
 paying customer,
Jason ...[snip mySQL commercial/non-commercial prospects]


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Reality check PYZOMA = python / zope for Mac ?

2000-12-24 Thread Steve Spicklemire


 "Jim" == Jim Harrison [EMAIL PROTECTED] writes:

 Does anyone know what Apple's plans are for MacOSX introduction
Jim haven't found a source for a compiled 1.5.2. I've tried to
Jim follow Steve's directions for the 1.5.2 build at
Jim http://www.zope.org/Members/sspickle/MacOSXBHFS but I
Jim haven't been successful with that as yet. I also tried Zope

Hmm... as an attempt to help with this I've uploaded stuff to

http://www.zope.org/Members/sspickle/MacOSXStuff

that you can download and install python and Zope on MacOSX. There are
minimal instructions there, but all the compiling has been
done all you should need is to:

as root:

#make install

in the Python-1.5.2 directory, and edit the 'stop' file (which has a
hard coded path in it) in the Zope-2.2.4-bin directory once you've
unpacked the files with gnutar. 

Here's what I did:

gnutar -xzvf pyth152.b.mosx.tgz
su
cd Python-1.5.2
make install
exit
gnutar -xzvf Zope-2.2.4.b.mosx.tgz
cd Zope-2.2.4-bin
sed s/steve/yourname/g  stop  newstop
mv newstop stop
./start

Let me know how it goes!

-steve




___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope-dev] Re: ZPatterns, ObjectDomain, UML and all that.....

2000-12-23 Thread Steve Spicklemire


Hi Itai,

 "Itai" == Itai Tavor [EMAIL PROTECTED] writes:

Itai I'm already using globally unique ids, but still, doesn't
Itai using the same id for the Participant and the Actor make
Itai these objects too tightly coupled? Seems to me that Actors
Itai should provide an interface for finding actors to the rest
Itai of the application; other objects should not make
Itai assumptions about the internal storage of Actors, and
Itai particularly what ids they use. No?

Well... there are two aspects here: 1) Who knows about how
various Participants and Actors are managed and 2) How are they actually
managed. Tight coupling is only about "1". It seems to me that "2" is
up to you as the developer to decide based on the particular
situation.

I'm sure that ZPatterns Zen is like most things... you learn by
getting your fingers burnt ;-). However it seems to me that it 
should be OK for an Xs Specialist to implement

getXforY( y_id )

or 

getXsforY( y_id )

(if there is more than one x for a single y.

If you have an XOR relationship, with several potential Specialists
I think you could either:

(A) iterate through the list of possible Specialists and ask each to
getXforY until you get a hit... 

or

(B) have a 'clearing house' Participants specialist, with a Rack for each of the 
Participant types and let it iterate through the racks and return
an object of the right type based on which one is a 'hit'. (Specialists
of course do this automatically!)

The advantage of (A) is, one less Specialist. The disadvantage is that
the Actor Specialist needs to 'know' about the list of Participant Specialists
itself.

The advantage of (B) is that the clearing house Specialist keeps track
of all the different Participants types... and the iteration is 'automatic'.

However... I think that either of these is 'OK' as far as coupling is 
concerned. In both cases the information about the different types
of Participant is kept in a single centralized place [(A) in the
Actors Specialist] and [(B) in the clearing house Specialist]. *If*
you had some *other* Specialist that also needed to iterate through the
various types of Participants... *then* B would be a clear advantage,
and probably worth the added complexity.

Anyway.. just my random thoughts.

-steve

(P.S. it was refreshing to hear pje mention that he and Ty had to "bite the 
bullet" and add new classes/Specialists on a project and only *after* that
it got much simpler, clearly implying that the original design was less
than perfect. It seems to us newbies sometimes that they possess
the Deific characteristic of near (object oriented) infallibility whereby
they produce clean, elegant, yet simple object oriented designs with the
same graceful ease with which they might compose a grocery list, while we
mortals struggle for hours and days to come up with something that they might
discard after a moment's thought. Anyway in the end we'll all learn the
most by hard experience, if only she were a more forgiving Mistress!)

(P.P.S. I still really like your idea of codifying some of these 
ZPatterns techniques into a sort of gallery of ZPatterns Implementations.
I'm working already on incorporating some of these into the ToDo example.)




___
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] Reality check PYZOMA = python / zope for Mac ?

2000-12-23 Thread Steve Spicklemire


Hi Jason,

Have you seen:   http://www.zope.org/Members/sspickle/MacOSXBHFS

Zope-2.3a1 runs with Python-1.5.2. I've run Zope-2.2.x on MacOSX 
and it runs great. At some point someone with time, or a paying customer,
or both will get an Open Database (MySQL, PostegreSQL, ... ) running on 
MacOSX and we'll have a full fledged solution. There is already a commercial
outfit selling MySQL stuff for MacOSX, so it's just a matter of time. ;-)

It will be interesting to see how Apple handles moving millions of
MacOS users to what is really a fundamentally different operating system
with unix under the hood  but that's for a different mailing list. ;-)

-steve


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] How to make two racks work under one specialist?

2000-12-22 Thread Steve Spicklemire


Hi Dirksen,

   OK.. the problem was that DataSkinAddons:DummyDataSkin doesn't
allow access to attributes of 'self'. Once I switched to a differnt
ZClass (which is a direct subclass of DataSkin) then everything
was fine again.. ) just for Facade instances:

I'm now using

WITH Deliverables.getItem(self.id) COMPUTE originalObject=RESULT or NOT_FOUND

with 'loaded by accessing attribute' set to 'originalObject'

and

WITH self.originalObject COMPUTE myName=name, myDescription=description, dueDate

then in the FacadeClass index_html:

dtml-var standard_html_header
I am a facade! dtml-var myName
hr
Description:dtml-var myDescriptionbr
hr
I'm due: dtml-var dueDate

dtml-var standard_html_footer

and all is working OK.  What ZClass are you using for your instances?

-steve

 "Steve" == Steve Spicklemire [EMAIL PROTECTED] writes:

Steve Hi Dirksen,

Steve Hmm.. this is starting to look like a bug. I tried the same
Steve thing with the ZPatterns example. I have a real site using
Steve this technique with ZPatterns-0.4.2a??  and it's working,
Steve so it's probably something introduced in 0.4.3. Here's what
Steve I did:

Steve I created a new Specialist 'Facade' with a
Steve DataSkinAddons:DummyDataSkin as it's storage class and
Steve 'originalObject' as the attribute to check for existence.

Steve Then I put in the following SkinScript:

Steve WITH Deliverables.getItem(self.id) COMPUTE
Steve originalObject=(RESULT is _.None) and NOT_FOUND or RESULT

Steve WITH self.originalObject COMPUTE name

Steve and ran in 'debug mode.' I get the following traceback on
Steve the console when I try to access a known deliverable
Steve through the Facade Specialist:

Steve Traceback (innermost last): File
Steve /usr/local/etc/Zope2a/lib/python/Products/ZPatterns/AttributeProviders.py,
Steve line 304, in _AttributeFor (Object: GAPMixin) File
Steve /usr/local/etc/Zope2a/lib/python/Products/ZPatterns/Expressions.py,
Steve line 122, in eval File
Steve /usr/local/etc/Zope2a/lib/python/DocumentTemplate/DT_Util.py,
Steve line 337, in eval (Object: Deliverables . getItem ( self
Steve . id )) (Info: Deliverables) File string, line 0, in ?
Steve File
Steve /usr/local/etc/Zope2a/lib/python/DocumentTemplate/DT_Util.py,
Steve line 140, in careful_getattr File
Steve /usr/local/etc/Zope2a/lib/python/Products/ZPatterns/Expressions.py,
Steve line 53, in validate File
Steve /usr/local/etc/Zope2a/lib/python/AccessControl/SecurityManager.py,
Steve line 139, in validate File
Steve /usr/local/etc/Zope2a/lib/python/AccessControl/ZopeSecurityPolicy.py,
Steve line 159, in validate Unauthorized: id

Steve I tried stepping through with the debugger... but got lost
Steve in the details of the GAP evaluator. I'll try again after
Steve breakfast and see what I can come up with.

Steve ;-)

Steve Look on the bright side. You're making ZPatterns a better
Steve product.

Steve -steve

 "Dirksen" == Dirksen  [EMAIL PROTECTED] writes:

Dirksen Hi Steve,

Dirksen I've made my experiment simple, by playing with the
Dirksen DumbZPatterns examples, testing one rack under one
Dirksen specialist. Here is the skinscript:

Dirksen WITH Deliverables.getItem(self.id) COMPUTE name=name,
Dirksen dueDate=dueDate, description=description, todoIDs=todoIDs

Dirksen WITH SELF COMPUTE name=name, dueDate='1973/01/01',
Dirksen description='unknown achee', todoIDs=[]

Dirksen The virtual instance is loaded by accessing attribute of
Dirksen 'name'. I thought any calls for inexistent objects in
Dirksen Deliverables would turn out default values. Yet the test
Dirksen result turned out an not_found error. The following
Dirksen modification (change to 'otherwise' clause) didn't make a
Dirksen difference:

Dirksen WITH Deliverables.getItem(self.id) COMPUTE name=name,
Dirksen dueDate=dueDate, description=description, todoIDs=todoIDs
Dirksen OTHERWISE LET name='unknown', dueDate='1973/01/01',
Dirksen description='unknown achee', todoIDs=[]


Dirksen One more question, i.e. the following expression WITH
Dirksen Deliverables.getItem(self.id) COMPUTE name, dueDate,
Dirksen description, todoIDs

Dirksen also trigered the 'not_known' error for every objects in
Dirksen Deliverables. Where goes wrong?

Dirksen Dirksen


Dirksen __ Do You
Dirksen Yahoo!?  Yahoo! Shopping - Thousands of Stores. Millions
Dirksen of Products.  http://shopping.yahoo.com/

Dirksen ___ Zope
Dirksen maillist - [EMAIL PROTECTED]
Dirksen http://lists.zope.org/mailman/listinfo/zope ** No cross
Dirksen posts or HTML encoding!  ** (Related lists -
Dirksen http://lists.zope.org/mailman/listinfo/zope-announce
Dirksen http://li

Re: [Zope] How to make two racks work under one specialist?

2000-12-22 Thread Steve Spicklemire


Hi Dirksen,

For your 'otherwise' case, could you have a single instance
that serves as an 'unknown' object:

WITH Deliverables.getItem(self.id) COMPUTE 
originalObject=RESULT or NOT_FOUND 
OTHERWISE originalObject=Deliverables.getItem('Unknown')

where it is known that the Deliverables Specialist has an 
instance with id='Unknown'. The problem with OTHERWISE is 
that it only works within the context of a single WITH/COMPUTE,
and if you don't get 'originalObject' then your WITH/COMPUTE
will never fire.

-steve

 "Dirksen" == Dirksen  [EMAIL PROTECTED] writes:

Dirksen Hi Steve,

Dirksen The first thing is, my ZPatterns' version was
Dirksen 0.4.3.b1. So I quickly downloaded b2, which passed my
Dirksen nameorassignlist, but still didn't fixed the fail-through
Dirksen problem.

Dirksen The 2nd thing is, your script turned out just fine in my
Dirksen case when calling existent deliverable objects. It just
Dirksen didn't fail-through, not even the 'otherwise' clause is
Dirksen applied. This is weird!

Dirksen cheers Dirksen


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] How to make two racks work under one specialist?

2000-12-21 Thread Steve Spicklemire


Hi Dirksen,

   Did you say you were using 0.4.3b1 or b2? I think that
this sounds like the bug from b1:

http://lists.zope.org/pipermail/zope-dev/2000-October/007650.html

-steve

 "Dirksen" == Dirksen  [EMAIL PROTECTED] writes:


Dirksen One more question, i.e. the following expression WITH
Dirksen Deliverables.getItem(self.id) COMPUTE name, dueDate,
Dirksen description, todoIDs

Dirksen also trigered the 'not_known' error for every objects in
Dirksen Deliverables. Where goes wrong?

Dirksen Dirksen


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] How to make two racks work under one specialist?

2000-12-21 Thread Steve Spicklemire


Hi Dirksen,

Hmm.. this is starting to look like a bug. I tried the same thing with the
ZPatterns example. I have a real site using this technique with ZPatterns-0.4.2a??
and it's working, so it's probably something introduced in 0.4.3. Here's what I 
did:

I created a new Specialist 'Facade' with a DataSkinAddons:DummyDataSkin
as it's storage class and 'originalObject' as the attribute to check
for existence.

Then I put in the following SkinScript:

WITH Deliverables.getItem(self.id) COMPUTE originalObject=(RESULT is _.None) and 
NOT_FOUND or RESULT

WITH self.originalObject COMPUTE name

and ran in 'debug mode.' I get the following traceback on the console when I
try to access a known deliverable through the Facade Specialist:

Traceback (innermost last):
  File /usr/local/etc/Zope2a/lib/python/Products/ZPatterns/AttributeProviders.py, line 
304, in _AttributeFor
(Object: GAPMixin)
  File /usr/local/etc/Zope2a/lib/python/Products/ZPatterns/Expressions.py, line 122, 
in eval
  File /usr/local/etc/Zope2a/lib/python/DocumentTemplate/DT_Util.py, line 337, in eval
(Object: Deliverables . getItem ( self . id  ))
(Info: Deliverables)
  File string, line 0, in ?
  File /usr/local/etc/Zope2a/lib/python/DocumentTemplate/DT_Util.py, line 140, in 
careful_getattr
  File /usr/local/etc/Zope2a/lib/python/Products/ZPatterns/Expressions.py, line 53, in 
validate
  File /usr/local/etc/Zope2a/lib/python/AccessControl/SecurityManager.py, line 139, in 
validate
  File /usr/local/etc/Zope2a/lib/python/AccessControl/ZopeSecurityPolicy.py, line 159, 
in validate
Unauthorized: id

I tried stepping through with the debugger... but got lost in the details of the 
GAP evaluator. I'll try again after breakfast and see what I can come up with.

;-)

Look on the bright side. You're making ZPatterns a better product. 

-steve

 "Dirksen" == Dirksen  [EMAIL PROTECTED] writes:

Dirksen Hi Steve,

Dirksen I've made my experiment simple, by playing with the
Dirksen DumbZPatterns examples, testing one rack under one
Dirksen specialist. Here is the skinscript:

Dirksen WITH Deliverables.getItem(self.id) COMPUTE name=name,
Dirksen dueDate=dueDate, description=description, todoIDs=todoIDs

Dirksen WITH SELF COMPUTE name=name, dueDate='1973/01/01',
Dirksen description='unknown achee', todoIDs=[]

Dirksen The virtual instance is loaded by accessing attribute of
Dirksen 'name'. I thought any calls for inexistent objects in
Dirksen Deliverables would turn out default values. Yet the test
Dirksen result turned out an not_found error. The following
Dirksen modification (change to 'otherwise' clause) didn't make a
Dirksen difference:

Dirksen WITH Deliverables.getItem(self.id) COMPUTE name=name,
Dirksen dueDate=dueDate, description=description, todoIDs=todoIDs
Dirksen OTHERWISE LET name='unknown', dueDate='1973/01/01',
Dirksen description='unknown achee', todoIDs=[]


Dirksen One more question, i.e. the following expression WITH
Dirksen Deliverables.getItem(self.id) COMPUTE name, dueDate,
Dirksen description, todoIDs

Dirksen also trigered the 'not_known' error for every objects in
Dirksen Deliverables. Where goes wrong?

Dirksen Dirksen


Dirksen __ Do You
Dirksen Yahoo!?  Yahoo! Shopping - Thousands of Stores. Millions
Dirksen of Products.  http://shopping.yahoo.com/

Dirksen ___ Zope
Dirksen maillist - [EMAIL PROTECTED]
Dirksen http://lists.zope.org/mailman/listinfo/zope ** No cross
Dirksen posts or HTML encoding!  ** (Related lists -
Dirksen http://lists.zope.org/mailman/listinfo/zope-announce
Dirksen http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope-dev] 'Subclassing' another product

2000-12-19 Thread Steve Spicklemire


Hi Morten,


   There are two ways to subclass products. You can use straightforward
Python subclassing:

e.g.,In your custom Product.. here is an example from Zwiff:

 import Products.PythonMethod.Guarded
 
 from Globals import HTMLFile, MessageDialog
 from App import Common
 
 manage_addZwiffForm = HTMLFile('addForm',globals())
 
 def manage_addZwiff(self, id, title, params, body, REQUEST=None):
 """Add A Zwiff to a folder  just like PythonMethod.. 
 """
 it = Zwiff(id, title, params, body)
 self._setObject(id, it)
 return self.manage_main(self, REQUEST)
 
 def handleMovieOutput(movie, RESPONSE):
 
 fname = tempfile.mktemp()
 
 movie.save(fname)
 
 f = open(fname)
 s = f.read()
 f.close()
 
 RESPONSE.setHeader('Content-type', 'application/x-shockwave-flash')
 
 os.remove(fname)
 
 return s
 
 class Zwiff (Products.PythonMethod.PythonMethod.PythonMethod ):
 
 meta_type = 'Zwiff'
 
 def makeFunction(self, compile=0):
 from Products.PythonMethod.Guarded import GuardedBlock, safefuncs, theGuard
 if compile:
 self._checkCBlock(GuardedBlock)
 if self.errors:
 raise "Python Method Error", string.join(self.errors, '\n')
 return self._newfun(compile, {'$guard': theGuard},
   __builtins__=mysafebin, _=safefuncs)
 
 

So the class Zwiff is a subclass of PythonMethod. Look at Zwiff for the full
source: http://www.zope.org/Members/sspickle/Zwiff

Or you can create a ZClass that subclasses from a 'base class'. To do
this you've got to register the base class with the ZClass machinery
(e.g., here is the code for ZCVSMixin that does this  ZCVSMixin
is a base class... CVSFolder is a full blown product that happens
to be a subclass of ZCVSMixin... )

 
 
 import ZCVSMixin
 import CVSFolder
 
 __doc__ = ZCVSMixin.__doc__
 __version__ = ZCVSMixin.__version__
 
 def initialize(context):
 context.registerClass(
 CVSFolder.CVSFolder,
 constructors=(CVSFolder.manage_addCVSFolderForm,
   CVSFolder.manage_addCVSFolder),
 icon='fish.gif',
 )
 context.registerBaseClass(ZCVSMixin.ZCVSMixin)
 

does that help?

take care,
-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] [BUG] Background processes interfere with Zope's HTTP responses

2000-12-19 Thread Steve Spicklemire


Hi Deiter,

   Hmm.. I just tried this with my highly experimental product
(LocalProc 0.0.1) and I didn't observe the same effect that you did
behind my Proxy Server. (I normally run with Rewrite... but when I got
your note I tried ProxyPass and it worked on the first try.)

(Good howto Anser! http://www.zope.org/Members/anser/apache_zserver/)

Anyway... I ran 'sleep 20' as my local process (I checked the
'background' button on my product) and the web page returned
immediately, but the process ran on in the background as I wished. The
main difference I see between what you are doing and what I do.. is
that I redirect stdout and stderr so that my subprocess has no open
files shared with the parent process.. anyway.. you might try this to
see if it suits your needs. Lightly tested on FreeBSD only.. but any
unix should work the same...

http://www.zope.org/Members/sspickle/LocalProc

-steve

 "Dieter" == Dieter Maurer [EMAIL PROTECTED] writes:

Dieter Today was again a hard Zope day.

Dieter Did you ever hear, that usually (i.e. if you do not do
Dieter special things) Zope renders a complete page before it
Dieter starts sending the result back to the client.  This
Dieter implies that you should never see only half of a page.

Dieter I heard it and I saw the code that does it.  Therefore, I
Dieter was convinced that this were really the case.

Dieter Then our client phoned:

Dieter   He visits a page that allows him to generate a
Dieter newsletter. When he presses the "generate newsletter
Dieter button", a result page is build that tells him that the
Dieter newsletter is being generated and send is a few minutes.

Dieter   He reported, that this response page is build only
Dieter half, then stops, to be completed only half a minute
Dieter later, at the same time when the newsletter arrives.  The
Dieter effect is reproducible. If newsletter generation takes
Dieter longer, he must wait longer for the page to complete.

Dieter   He is convinced that we generate the newsletter
Dieter synchronously and let him wait until the generation is
Dieter complete.  And he is angry.

Dieter   I know, that the newsletter is generated in a
Dieter background process, started in an external method with:

Dieteros.system("gen_newsletter ")

Dieter   I try to reproduce the behaviour in our test
Dieter environment and fail. I do not have to wait, until the
Dieter newsletter generation finished. Then, I use the official
Dieter service URL and see, I observe the same behaviour.  The
Dieter difference: in the test environment, the browser connects
Dieter directly to ZServer; with the official URL, it connects
Dieter via a proxy.

Dieter   Puzzling!


Dieter What happened?

Dieter  The background process inherits Zope's open file
Dieter descriptors.  Among them are all currently open HTTP
Dieter request sockets.  The process keeps these sockets open
Dieter until it finishes.

Dieter  There are two HTTP modes:

Dieter1. single request mode a new TCP connection is
Dieter created for each HTTP request, the request is completed,
Dieter when the TCP connection is closed.

Dieter2. multi request mode several requests share a
Dieter single TCP connection.  The "Content-Length" HTTP header
Dieter allows client and server to determine the request
Dieter boundaries.

Dieter  That means: when a client uses the multi request
Dieter mode, everything is fine. Clients, however, that use the
Dieter single request mode wait until their connection is closed
Dieter and can observe serious delays.

Dieter  These delays may be very difficult to explain, as the
Dieter background process not only delays its own request but may
Dieter delay arbitrary other requests that happen to be served at
Dieter the same time.



Dieter How to fix the problem:

Dieter   There should be a (file) control "CloseOnExec", that
Dieter tells Unix to automatically close the file like object
Dieter upon an exec.  ZServer should probably use it on each of
Dieter its sockets.  I can not see a serious application that
Dieter should have direct access to ZServer's HTTP request
Dieter socket.


Dieter I will soon file a bug report into the Collector.


Dieter Dieter

Dieter ___ Zope
Dieter maillist - [EMAIL PROTECTED]
Dieter http://lists.zope.org/mailman/listinfo/zope ** No cross
Dieter posts or HTML encoding!  ** (Related lists -
Dieter http://lists.zope.org/mailman/listinfo/zope-announce
Dieter http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   

Re: [Zope] How to make two racks work under one specialist?

2000-12-18 Thread Steve Spicklemire


Hi Dirksen,

   Ok.. you need to set the 'load by accessing attribute' field
to 'original_object'. You may need to change your SkinScript to
something like:

WITH getMale(self.id) COMPUTE original_object=(RESULT is _.None) and NOT_FOUND or 
RESULT

So that when getMale returns _.None, the SkinScript returns NOT_FOUND

-steve

 "Dirksen" == Dirksen  [EMAIL PROTECTED] writes:

Dirksen Hi Steve,

Dirksen Both racks are set to be loaded by accessing 'id', which,
Dirksen as you guessed right, don't appear in handling attributes
Dirksen list!

Dirksen This is the simplified skinscript in maleMemberRack: WITH
Dirksen getMale(self.id) COMPUTE original_object=RESULT WITH
Dirksen self.original_object COMPUTE name=id, gender=gender,
Dirksen email=email

Dirksen getMale is a python method: member = getMember(id) if
Dirksen id.gender == 'male': return member

Dirksen Things just go opposite direction in femaleMemberRack.

Dirksen What do you think?

Dirksen Dirksen




Dirksen __ Do You
Dirksen Yahoo!?  Yahoo! Shopping - Thousands of Stores. Millions
Dirksen of Products.  http://shopping.yahoo.com/

Dirksen ___ Zope
Dirksen maillist - [EMAIL PROTECTED]
Dirksen http://lists.zope.org/mailman/listinfo/zope ** No cross
Dirksen posts or HTML encoding!  ** (Related lists -
Dirksen http://lists.zope.org/mailman/listinfo/zope-announce
Dirksen http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] skinscript and ZSQL

2000-12-17 Thread Steve Spicklemire


Hi Aaron,

   Since we communicated privately and I now have a much better
understanding of your problem, I realized that my last message to the
list was unclear so I thought I'd take a moment to try to clarify the
'gotchas' that got you, as I see them, so that other folks might not
so easily fall into the same problems. 

   Since you started with 
"DumbZPatternsExample":http://www.zope.org/Members/sspickle/DumbZPatternsExample
others might be able to follow along better if they refer to that 
example.

Situation: 

You're creating a class that is used as a 'stand-in' for
objects stored in an SQL database. You're using ZPatterns to implement
this stand-in-ability.

These objects have the following attributes (these also correspond to
column names for the table that lives in the SQL database, in your
case, gadfly.)

client_name, email, rate, last_payment, primary, and services.

client_name is used as the 'id' of the object when it is
instantiated in Zope.

In order to accomplish this you:

1) Create a ZClass (ClientObject) to act as the stand-in. 
 1a) set up methods of the ZClass 

  editInstance: self.propertysheets.Basic.manage_changeProperties(REQUEST)
  editInstanceForm: (form to edit the properties of an instance)
  editInstanceInterface: (UI method that calls editInstance to get modification done)
  index_html: (display this instance)

 1b) set up propertysheet for ZClass
  add properties: email, rate, last_payment, primary and services.
   do *not* set up a property for client_name since it is really
   going to be the 'id', and also the property that the rack uses to see
   if the object was found in the database. 

   [ If 'client_name' were propertysheet-property then the Rack could
   create a virtual instance, and then attemt to access the property
   'client_name'. This would then fire the trigger that queries the
   database, which would fail (leaving the virtual instance
   unchanged).  Since the virtual instance is an instance of your
   ZClass even though the query failed the Rack would *still* get a
   valid value for the property from the ZClass property sheet!
   This is why you were getting the 'already exists' error in
   the first place. Taking the 'client_name' property out of the
   ZClass fixes this problem. ]

2) Create a Specialist with a Rack that manages the ZClass instances
   that represent the objects from your database.

  2a) In the Rack set the Storage tab so that it uses ClientObject
   as the class of objects it manages, and choose "loaded by accessing attribute"
   rather than "stored persistently". Set the attribute to 'client_name'.

  2b) In the "Data PlugIns" tab clear out the persistent PlugIns and
   replace them with a single SkinScript method with the following
   lines:
   
   

WHEN OBJECT ADDED CALL sqlInsertProduct(client_name=self.id, 
email=self.email, rate=self.rate, last_payment=self.last_payment, 
primary=self.primary, services=self.services)

WHEN OBJECT CHANGED STORE email, rate, last_payment, primary, services 
USING sqlUpdateProduct(client_name=self.id, email=self.email, rate=self.rate, 
last_payment=self.last_payment, primary=self.primary, services=self.services)

WHEN OBJECT DELETED CALL sqlDeleteProduct(client_name=self.id)

WITH QUERY lookup_product(client_name=self.id) COMPUTE 
client_name, email,rate,last_payment,primary,services



(The 'STORE ..' part on the WHEN OBJECT CHANGED line is
important to ensure that the Rack knows that these attributes
are being stored with this command.)

  2c) Add ZSQL Methods, Python Methods/Scripts and DTML methods to the
Speciliast so that it can carry out it's program.  Everything
*but* the SQL methods are covered in the previously mentioned
example. Here I'll only describe the ZSQL Methods used by the
SkinScript:

ZSQL Methods:

sqlInsertProduct, args: 

client_name email rate last_payment primary services

code:

INSERT INTO clienttracker_table
(client_name, email, rate, last_payment, primary, services)
VALUES
(
dtml-sqlvar client_name type=string,
dtml-sqlvar email type=string,
dtml-sqlvar rate type=string,
dtml-sqlvar last_payment type=string, 
dtml-sqlvar primary type=string, 
dtml-sqlvar services type=string 
)


sqlUpdateProduct, args:

client_name email rate last_payment primary services

code:

UPDATE clienttracker_table SET
email=dtml-sqlvar email type=string, 
rate=dtml-sqlvar rate type=string, 
last_payment=dtml-sqlvar last_payment type=string, 
primary=dtml-sqlvar primary type=string, 
services=dtml-sqlvar services type=string
where client_name=dtml-sqlvar client_name type=string

sqlDeleteProduct, args:

client_name

code:

   

Re: [Zope] How to make two racks work under one specialist?

2000-12-16 Thread Steve Spicklemire


Hi Dirksen,

   Hmm... why not have the query that gets data qualify by gender:

SQL Query: getMemberByGender

parameters member_id, gender

select * from members where
  dtml-sqltest member_id type=string and dtml-sqltest gender type=string

Then in the SkinScript for maleMemberRack:

WITH QUERY getMemberByGender(member_id=self.id, gender='male') COMPUTE blah, blah, 
blah 

-steve

 "Dirksen" == Dirksen  [EMAIL PROTECTED] writes:

Dirksen I set up two racks in one specialist, one is
Dirksen maleMemberRack, the other femaleMemberRack.  Both are
Dirksen loaded by accessing attribute id, and have skinscripts to
Dirksen retrieve data from a db. Suppose the femaleMemberRack
Dirksen gets loaded first, it finds out from the db that the 'id'
Dirksen is a male, then how can it pass the process to the
Dirksen maleMemberRack?

Dirksen Dirksen

Dirksen __ Do You
Dirksen Yahoo!?  Yahoo! Shopping - Thousands of Stores. Millions
Dirksen of Products.  http://shopping.yahoo.com/

Dirksen ___ Zope
Dirksen maillist - [EMAIL PROTECTED]
Dirksen http://lists.zope.org/mailman/listinfo/zope ** No cross
Dirksen posts or HTML encoding!  ** (Related lists -
Dirksen http://lists.zope.org/mailman/listinfo/zope-announce
Dirksen http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] How to make two racks work under one specialist?

2000-12-16 Thread Steve Spicklemire


Hi Dirksen,

   Forgot to mention... you should probably choose some attribute other 
than 'id' as the attribute to check for your DataSkin. The 'id' attribute
is always there... 

-steve

 "Steve" == Steve Spicklemire [EMAIL PROTECTED] writes:

Steve Hi Dirksen,

SteveHmm... why not have the query that gets data qualify by
Steve gender:

Steve SQL Query: getMemberByGender

Steve parameters member_id, gender

Steve select * from members where dtml-sqltest member_id
Steve type=string and dtml-sqltest gender type=string

Steve Then in the SkinScript for maleMemberRack:

Steve WITH QUERY getMemberByGender(member_id=self.id,
Steve gender='male') COMPUTE blah, blah, blah

Steve -steve

 "Dirksen" == Dirksen  [EMAIL PROTECTED] writes:

Dirksen I set up two racks in one specialist, one is
Dirksen maleMemberRack, the other femaleMemberRack.  Both are
Dirksen loaded by accessing attribute id, and have skinscripts to
Dirksen retrieve data from a db. Suppose the femaleMemberRack
Dirksen gets loaded first, it finds out from the db that the 'id'
Dirksen is a male, then how can it pass the process to the
Dirksen maleMemberRack?

Dirksen Dirksen

Dirksen __ Do You
Dirksen Yahoo!?  Yahoo! Shopping - Thousands of Stores. Millions
Dirksen of Products.  http://shopping.yahoo.com/

Dirksen ___ Zope
Dirksen maillist - [EMAIL PROTECTED]
Dirksen http://lists.zope.org/mailman/listinfo/zope ** No cross
Dirksen posts or HTML encoding!  ** (Related lists -
Dirksen http://lists.zope.org/mailman/listinfo/zope-announce
Dirksen http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] skinscript and ZSQL

2000-12-16 Thread Steve Spicklemire


This set works for me:

--

WHEN OBJECT ADDED CALL sqlInsertProduct(client_name=self.id, 
email=self.email, rate=self.rate, last_payment=self.last_payment, 
primary=self.primary, services=self.services)

WHEN OBJECT CHANGED STORE email, rate, last_payment, primary, services 
USING sqlUpdateProduct(client_name=self.id, email=self.email, rate=self.rate, 
last_payment=self.last_payment, primary=self.primary, services=self.services)

WHEN OBJECT DELETED CALL sqlDeleteProduct(client_name=self.id)

WITH QUERY lookup_product(client_name=self.id) COMPUTE 
client_name,email,rate,last_payment,primary,services

--

Where each of the queries does the 'right' thing. You generally don't
want to attribute that you are using for the 'id' to be present in any
propertysheet since that property will come from the ZClass and fool
the 'Virtual' instance machinery. Note that if you don't specify "STORE"
on the WHEN OBJECT CHANGED line then you'll have trouble with the
Rack not being able to find attribute storage for the changed
property.

Good Luck!
-steve

 "AP" == Aaron Payne [EMAIL PROTECTED] writes:

AP Hi all,

AP I'm trying to use Gadfly as storage for a Zpatterns rack.
AP With the following skinscript trigger I can view records in
AP the database.  But I can't insert a new one.

AP WHEN OBJECT ADDED CALL sqlInsertProduct()

AP WITH QUERY lookup_product(client_name=self.id) COMPUTE
AP client_name,email,rate,last_payment,primary,services

AP Where:

AP sqlInsertProduct is a zsql method.  args: client_name email
AP rate last_payment primary services Query template: INSERT INTO
AP clienttracker_table (client_name, email, rate, last_payment,
AP primary, services) VALUES ( 'dtml-var client_name',
AP 'dtml-var email', 'dtml-var rate', 'dtml-var
AP last_payment', 'dtml-var primary', 'dtml-var services' )

AP lookup_product is a zsql method.  args: client_name Query
AP template: select * from clienttracker_table where
AP dtml-sqltest client_name type=string


AP client_name,email,rate,last_payment,primary,services are
AP fields of the table clienttracker_table and properties of the
AP dataskin.

AP If I remove "=self.id" from the trigger I am able to add a
AP record to the db through the trigger.  Without "=self.id" in
AP the trigger I am unable to view the records in the db.


AP I noticed in a post today that said

AP ... you should probably choose some attribute other than 'id'
AP as the attribute to check for your DataSkin. The 'id'
AP attribute is always there...

AP Objects are loaded by accessing attribute client_name and I
AP still get the "object already exists" error.

AP Questions: -Should I just create the record directly with the
AP zsql method?  That would defeat the purpose of using
AP ZPatterns.  -How do I eliminate the "already exists" error

AP Zope version: Zope 2.2.1 Python version: 1.5.2 System
AP Platform: freebsd4

AP -Aaron


AP ___ Zope maillist
AP - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope **
AP No cross posts or HTML encoding!  ** (Related lists -
AP http://lists.zope.org/mailman/listinfo/zope-announce
AP http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope-dev] Adding and setting properties from a virtual Specialist

2000-12-13 Thread Steve Spicklemire


Hi Itai,

 "Itai" == Itai Tavor [EMAIL PROTECTED] writes:

Itai "OrderingEntities.getItem(some_id).current_order_id)" shows
Itai me the value of current_order_id of the Employee object
Itai some_id. But I can't figure out how to change the property
Itai so it get changed in the Employee object. dtml-call
Itai 
"OrderingEntities.getItem(some_id).manage_changeProperties(current_order_id='123')"
Itai does nothing, it doesn't even trigger the WHEN OBJECT
Itai CHANGED line (not that I really expected it to work... this
Itai object is virtual, how can I call changeProperties on it?)

How about 
'OrderingEntities.getItem(some_id).propertysheets.TheRightPropertysheet.manage_changeProperties()

or you could create an external method to set the property you want... 

YourExternalMethod( OrderingEntities.getItem(some_id), theValue)

where

def YourExternalMethod( theObject, theValue):
setattr(theObject, 'current_order_id', theValue)

I think these could/should work...

Itai Other than figuring out how to get the change to work, I two
Itai more problems:

Itai -Eventually the OrderingEntities Specialist will have
Itai several Racks mapping to several other Specialists, so it
Itai will end up returning different classes. Should I instead
Itai create a new ZClass with just the current_order_id property
Itai and use this class in all the virtual Racks?

This is what I do in most cases... each rack has different SkinScript
to map the attributes of different classes onto the common attribute
set of the single Storage class used by all the racks.

Itai - How do I add a property to the original object from the
Itai virtual object (assuming I did not add it manually to the
Itai Employee class)? Do I call
Itai self.original_object.manage_addProperty(...) from the
Itai SkinScript?

I think this should work  but it will only add the propertysheet
to the instance.. not the class. If the property is completely missing
from the original class then it seems to me either there is really no
real need to save it there... or the class was incomplete somehow to
begin with... and it should be added at the ZClass level..

Just random thoughts... 

;-)

-steve


Itai TIA -- Itai Tavor "Je sautille, donc je suis."  C3Works
Itai [EMAIL PROTECTED] - Kermit the Frog

Itai "If you haven't got your health, you haven't got anything"


Itai ___ Zope-Dev
Itai maillist - [EMAIL PROTECTED]
Itai http://lists.zope.org/mailman/listinfo/zope-dev ** No cross
Itai posts or HTML encoding!  ** (Related lists -
Itai http://lists.zope.org/mailman/listinfo/zope-announce
Itai http://lists.zope.org/mailman/listinfo/zope )


___
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] Adding and setting properties from a virtualSpecialist

2000-12-13 Thread Steve Spicklemire


Hi Itai,

 "Itai" == Itai Tavor [EMAIL PROTECTED] writes:

Itai Say I got several Participants, and some of those need to be
Itai able to place orders. I create the Specialist
Itai OrderingEntities to implement the role of 'someone who
Itai places orders'. From what I understand about using
Itai Specialists to extend a class behavior, this Specialist
Itai should add the properties it needs to track orders with to
Itai the Participant classes - I should not have to go in to
Itai every Participant class and add the property to it, because
Itai those classes don't know and don't care that they might be
Itai used in this role. Am I wrong in this?  Otherwise, the only
Itai other way to track properties for this role would be to
Itai physically store a new object on the OrderingEntities Rack
Itai for every Participant class accessed, but what's the point
Itai in that, if I can simply add the property to the original
Itai class?

No.. you're right here. I've never used property sheets in this way,
just because it's seemed too much trouble to check for existence, then
add if necessary... etc. If I need to have a property set in an
instance... I just set it, using an external method. (Or I add it at
the ZClass level.) It's important to be careful though... if there is
already a property with that name there could be a clash. 
Obviously application integration needs to be done with full
awareness of the different attributes used by each component.

Itai Making small steps up the ZPatterns mountain (and too many
Itai of them backwards),

Yup.. me too. ;-) But it's better than sticks and bones..

take care,
-steve

Itai Itai -- Itai Tavor "Je sautille, donc je suis."  C3Works
Itai [EMAIL PROTECTED] - Kermit the Frog

Itai "If you haven't got your health, you haven't got anything"


___
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] HTTP status code 302

2000-12-10 Thread Steve Spicklemire


Hi Hung Jung,

   Did you set a 'Host' header in your request? Is
the request going straight to ZServer, or through
Apache? (Also... do you have a SiteRoot?) These can
all affect how the request is handled by the server...

It woould be interesting to try urllib, rather than
httplib since it handles the Host header for you...

-steve

 "Hung" == Hung Jung Lu [EMAIL PROTECTED] writes:

Hung I can view certain document on a Zope site over the web if I
Hung use a = brower. But for fun I tried to download it by using
Hung Python's httplib, = and for some Zope sites got a status
Hung code 302. This probably means I = need to use another URL
Hung address. The web browser does this automatically = so I
Hung don't need to do anything. But I can't seem to find the
Hung right URL.=20

Hung Reading from http://www.w3.org/Protocols/HTTP/HTRESP.html ,
Hung it says that = when 302 happens, the header line would be

Hung URI: url String CrLf

Hung But I don't see this line in the returned header. And the
Hung returned body = is an HTML telling me the document has been
Hung moved. Funny thing is that = browsers (IE, Netscape) do not
Hung have problems with it.

Hung Is this a limitation of Python's httplib (not showing the
Hung URI in the = response header)? Is there a way to circumvent
Hung it? Or does this have to = do with virtual hosting, or
Hung Apache stuff?

Hung Thanks,

Hung Hung Jung


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] HTTP status code 302

2000-12-10 Thread Steve Spicklemire


Hi Hung,

   No! Urllib does that too!

import urllib
x = urllib.urlopen('http://user:pass@host:8080/path/to/get')
print x.read()

-steve

 "Hung" == Hung Jung Lu [EMAIL PROTECTED] writes:

Hung From: "Steve Spicklemire" [EMAIL PROTECTED]
 Did you set a 'Host' header in your request? Is the request
 going straight to ZServer, or through Apache? (Also... do you
 have a SiteRoot?) These can all affect how the request is
 handled by the server...

Hung Ahh... that's it. Thank you very much!! Virtual hosting was
Hung the problem.  After supplying the 'Host' header, everything
Hung was fine.

Hung The httplib offers more control, I think. It allows me to
Hung supply the 'Authorization' header. The urllib probably does
Hung not do that, right?

Hung That being said, I am still not 100% familiar with all the
Hung HTTP headers (for both request and response), it's like I
Hung learn one at a time. :) Do you know any pointer where I can
Hung get info on all the headers?

Hung regards,

Hung Hung Jung


Hung ___ Zope
Hung maillist - [EMAIL PROTECTED]
Hung http://lists.zope.org/mailman/listinfo/zope ** No cross
Hung posts or HTML encoding!  ** (Related lists -
Hung http://lists.zope.org/mailman/listinfo/zope-announce
Hung http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] just curious

2000-12-07 Thread Steve Spicklemire


wget?

-steve

 "michael" == michael angelo ruberto [EMAIL PROTECTED] writes:

michael what i meant was, is there a way to remove my files in
michael Zope back to the filesystem? i'm having serious concerns
michael about the stability of this product and need to know if i
michael can gracefully revert back.



michael -Original Message- From: [EMAIL PROTECTED]
michael [mailto:[EMAIL PROTECTED]]On Behalf Of Chris McDonough
michael Sent: Wednesday, December 06, 2000 12:05 AM To:
michael [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re:
michael [Zope] just curious


michael What?

michael - Original Message - From: "michael angelo
michael ruberto" [EMAIL PROTECTED] To: [EMAIL PROTECTED]
michael Sent: Tuesday, December 05, 2000 7:33 PM Subject: [Zope]
michael just curious


 hi,
 
 how do i remove all of the 7000 + company documents from Zope?
 
 -mike-
 
 ___ Zope maillist -
 [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No
 cross posts or HTML encoding!  ** (Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )
 
 


michael ___ Zope
michael maillist - [EMAIL PROTECTED]
michael http://lists.zope.org/mailman/listinfo/zope ** No cross
michael posts or HTML encoding!  ** (Related lists -
michael http://lists.zope.org/mailman/listinfo/zope-announce
michael http://lists.zope.org/mailman/listinfo/zope-dev )


michael ___ Zope
michael maillist - [EMAIL PROTECTED]
michael http://lists.zope.org/mailman/listinfo/zope ** No cross
michael posts or HTML encoding!  ** (Related lists -
michael http://lists.zope.org/mailman/listinfo/zope-announce
michael http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Zope 2.2.4 dying under Solaris 2.6

2000-12-07 Thread Steve Spicklemire


It might be interesting to turn on the -M option of z2.py and see if
there is any pattern to the crash. This can happen for a number of
reasons (e.g., a buggy Python extension, an infinite recursive loop,
).

-steve

 "Michael" == Michael Best [EMAIL PROTECTED] writes:

Michael I have had Zope 2.0.1, Zope 2.1.6 and Zope 2.2.4 running
Michael on Solaris 2.6 and inexplicably, every so often (no
Michael definiate amount of time) the Zope dies.

Michael Any ideas?

Michael -- A typical entry from STUPID_LOG is:
Michael 2000-12-07T18:23:22 ERROR(200) zdaemon zdaemon: Thu Dec 7
Michael 11:23:22 2000: Aiieee! 17564 exited with error code: 11
Michael -- Summarized:

Michael Mon Dec 4 13:56:22 2000: 5527 exited with error code: 11
Michael Mon Dec 4 16:40:13 2000: 10558 exited with error code: 11
Michael Mon Dec 4 17:21:22 2000: 10806 exited with error code: 11
Michael Mon Dec 4 18:08:26 2000: 10876 exited with error code: 11
Michael Mon Dec 4 19:15:57 2000: 10927 exited with error code: 11
Michael Mon Dec 4 19:57:14 2000: 11001 exited with error code: 11
Michael Mon Dec 4 20:34:32 2000: 11034 exited with error code: 11
Michael Mon Dec 4 22:30:00 2000: 11085 exited with error code: 11
Michael Tue Dec 5 01:17:39 2000: 11193 exited with error code: 11
Michael Tue Dec 5 04:07:23 2000: 11384 exited with error code: 11
Michael Tue Dec 5 08:16:33 2000: 11613 exited with error code: 11
Michael Tue Dec 5 11:22:32 2000: 11864 exited with error code: 11
Michael Tue Dec 5 15:00:00 2000: 12375 exited with error code: 11
Michael Tue Dec 5 19:17:21 2000: 12527 exited with error code: 11
Michael Tue Dec 5 20:42:58 2000: 12927 exited with error code: 11
Michael Tue Dec 5 21:37:00 2000: 13077 exited with error code: 11
Michael Tue Dec 5 23:59:01 2000: 13152 exited with error code: 11
Michael Wed Dec 6 12:01:03 2000: 14226 exited with error code: 11
Michael Wed Dec 6 13:51:26 2000: 14277 exited with error code: 11
Michael Wed Dec 6 14:39:57 2000: 14436 exited with error code: 11
Michael Wed Dec 6 14:48:08 2000: 14561 exited with error code: 11
Michael Wed Dec 6 18:02:12 2000: 14596 exited with error code: 11
Michael Wed Dec 6 18:42:59 2000: 14844 exited with error code: 11
Michael Wed Dec 6 22:53:53 2000: 14879 exited with error code: 11
Michael Thu Dec 7 03:25:20 2000: 15187 exited with error code: 11
Michael Thu Dec 7 06:59:31 2000: 15505 exited with error code: 11
Michael Thu Dec 7 09:16:11 2000: 15786 exited with error code: 11
Michael Thu Dec 7 10:06:05 2000: 17377 exited with error code: 11
Michael Thu Dec 7 10:51:56 2000: 17462 exited with error code: 11
Michael Thu Dec 7 11:23:22 2000: 17564 exited with error code: 11

Michael -- Michael Best Systems Administrator ph 780-413-6397
Michael x230 Emergence By Design fax 780-433-7548 #200, 11209
Michael Jasper Avenue toll 866-860-2666 Edmonton, Alberta, T5K
Michael 0L5

Michael ___ Zope
Michael maillist - [EMAIL PROTECTED]
Michael http://lists.zope.org/mailman/listinfo/zope ** No cross
Michael posts or HTML encoding!  ** (Related lists -
Michael http://lists.zope.org/mailman/listinfo/zope-announce
Michael http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope-dev] Implementing [XOR A] 1 object connections in ZPatterns

2000-12-05 Thread Steve Spicklemire


Hi Itai,

 "Itai" == Itai Tavor [EMAIL PROTECTED] writes:

...

Itai The 2nd way seems to go better with OO principles - all
Itai handling of photos is delegated to the Photos Specialist and
Itai the Product doesn't care if the photo exists or not, or
Itai where it comes from. But it also increases complexity in
Itai Photos, because I need to implement an efficient way to
Itai retrieve photos (with a Catalog, or SQL searches), and
Itai because it introduces the photo_key. Storing photo_id in
Itai Product eliminates these complexities, but it moves some of
Itai the responsibility for managing photos into Product.

Hmmm.. it seems to me that it makes more sense for the Product 
to know the id of the Photo that *it* needs to display itself than
for the Photo to have to know that it belongs to a particular
Product. Also.. I can imagine that the Photo class might be useful
for lots of other things besides Products, and how would you teach
it what type of object it belongs to?

Just my $0.02. 

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




[Zope-dev] Re: ZPatterns, ObjectDomain, UML and all that.....

2000-12-05 Thread Steve Spicklemire


Thanks Roche!

 "RC" == RC Compaan [EMAIL PROTECTED] writes:

RC Hi Steve

RC I'm also a babe in the woods when it comes to object
RC modelling, but here's my pennie's worth.  Since code
RC generation was not really required in the models I recently
RC did for Zope Apps and the terrible exchange rate on the South
RC African Rand I decided to use to very light weight Playground
RC modelling tool.  I agree with Steve Alexander that Coad
RC notation serves ZPatterns *better* and this is exactly what
RC Playground uses.

Ahh.. alas Playground is Win only (if I'm thinking correctly that it's
the software that came in Coad's book), and I loaned tbe book and CD
to someone else ... g... ;-)

RC Take the Customer with Address property example: I create
RC Customer and Address Dataskins.  For Customer I have an
RC external method setAddress which sets the Address property of
RC my Customer object and this is how I would create a new
RC Customer: newCustomer = customerRack.newItem( CustomerCounter
RC ) newAddress = addressRack.newItem( AddressCounter )
RC newCustomer.setAddress( newAddress )

RC I prefer the simplicity this brings when I have to access the
RC properties of a Customer (without having to call a getter each
RC time I need an address): myCustomer.Address.Street

RC This also maps quite simply to SQL storage.

RC So although instances of Address are properties of Customer
RC they live on their own Rack and instances of Customer simply
RC refers to their Address through assignment.

Thanks... is that working between transactions? It has me a little
confused.  I've been snooping through the implementation of ZPatterns
for a clue and it looks to me like:

 a) the data manager for a DataSkin is a non-persistent attribute.
(self._v_dm_). I think this means that it needs to be set
somehow in every Zope transaction before you can do much of
anything with the instance.

 b) For Rack mounted DataSkins this should happen when the item is
retrieved from the Rack, and basically should be set to the Rack
itself.

 c) If an object is set as an attribute of another DataSkin won't
its data manager be lost at the end of the transaction?
How does it find its rack again at the next transaction?

 I too like the simplicity of setting attributes rather than
 saving IDs, and that may lead me to experiement with the
 folder/customizer stuff but right now I'm still doing
 specialists/racks ( for some reason... that's where I started! )

RC With Container/Content type objects I do roughly the same - I
RC have setContainer methods for the Content objects.

So most of your objects are defined in Python products, or are these
methods ExternalMethods?

thanks!
-steve

RC 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] How to build a c extension on a linux system

2000-12-04 Thread Steve Spicklemire



I keep my own CVS'ed versions of ZPatterns and PlugIns so I can
patch/change with a little control. For my own convenience I 
put a build.py file in the ZPatterns directory and my usual
sequence is:


cvs co ZPatterns
cvs co PlugIns

cd ZPatterns
python build.py

this way I don't have to think very hard when 
I'm installing on a new Zope 


build.py:
--
import os


os.system('cp /usr/local/lib/python1.5/config/Makefile.pre.in .')
os.system('make -f Makefile.pre.in boot')
os.system('make')

--

Is that what you're looking for?

-steve

R 
R 
R i would like to install a zope product that includes a c extension
R (DynPersist.c) with a Setup file like this:
R 
R *shared*
R DynPersist DynPersist.c-I../../ZODB
R -I../../../Components/ExtensionClass
R 
R has anybody an idea, how to start the compilation ?
R thx Ruediger
R 
R ~
R http://www.herrenausstatter.de - Der Online-Herrenausstatter
R Kostenlose Serviceline: 0800 -999 66 33
R Versandkostenfreie Lieferung - 30 Tage Rückgaberecht
R ~
R Verwaltungsadresse:
R DePauli.com Aktiengesellschaft
R Stahlgruberring 3 - 81829 München
R Telefon: 089 / 530 75 170 - Telefax 089 / 514 50 666
R 
R ___
R Zope maillist  -  [EMAIL PROTECTED]
R http://lists.zope.org/mailman/listinfo/zope
R **   No cross posts or HTML encoding!  **
R (Related lists - 
R  http://lists.zope.org/mailman/listinfo/zope-announce
R  http://lists.zope.org/mailman/listinfo/zope-dev )
R 

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope-dev] ZPoPyDA for FreeBSD... was (Hmmmm.... what do *you* do when Zope is 'stuck'.)

2000-12-03 Thread Steve Spicklemire


Thanks... I'm pretty sure now that what I was was pthreads/popy
related.  I didn't realize there was a new/updated PoPy/ZPoPyDA on the
zope site with lots of thread related (sem_init, sem_wait,... )
changes so I built it on my FreeBSD boxen and haven't seen the same
behavior since.

-steve

P.S.

here are the changes I made to build on FreeBSD:

diff -c -r1.1.1.1 -r1.2
*** PoPymodule.h2000/12/03 14:06:38 1.1.1.1
--- PoPymodule.h2000/12/03 14:09:57 1.2
***
*** 38,43 
--- 38,44 
  #include catalog/pg_type.h
  #include libpq-fe.h
  #include libpq/libpq-fs.h
+ #include sys/types.h
  #include regex.h
  #include string.h
  #include stdlib.h


and 

mercury.spvi.com diff -c foop/pythonmods/PoPy/Makefile foo/pythonmods/PoPy/Makefile
*** old/Makefile   Sun Dec  3 18:06:58 2000
--- new/MakefileSun Dec  3 09:43:00 2000
***
*** 88,94 
  TARGET=   python
  
  # Add more -I and -D options here
! CFLAGS=   $(OPT) -I$(INCLUDEPY) -I$(LIBPL) $(DEFS) 
-I/usr/local/pgsql/include/ -Wall \
-DVERSION=\"1.4.1\"
  
  # These two variables can be set in Setup to merge extensions.
--- 88,94 
  TARGET=   python
  
  # Add more -I and -D options here
! CFLAGS=   $(OPT) -pthread -I$(INCLUDEPY) -I$(LIBPL) $(DEFS) 
-I/usr/local/pgsql/include  
-I/usr/ports/databases/postgresql7/work/postgresql-7.0.2/src/include -Wall \
-DVERSION=\"1.4.1\"
  
  # These two variables can be set in Setup to merge extensions.
***
*** 114,120 
  LINKCC=   $(PURIFY) $(CC)
  SGI_ABI=  
  OPT=  -fomit-frame-pointer -O6
! LDFLAGS=  -L/usr/local/pgsql/lib/ 
  LDLAST=   
  DEFS=  -DHAVE_CONFIG_H=1  -DHAVE_LIBCRYPT=1 
  LIBS= -lcrypt -lc_r
--- 114,120 
  LINKCC=   $(PURIFY) $(CC)
  SGI_ABI=  
  OPT=  -fomit-frame-pointer -O6
! LDFLAGS=  -L/usr/local/pgsql/lib 
  LDLAST=   
  DEFS=  -DHAVE_CONFIG_H=1  -DHAVE_LIBCRYPT=1 
  LIBS= -lcrypt -lc_r
***
*** 123,129 
  RANLIB=   ranlib
  MACHDEP=  freebsd3
  SO=   .so
! LDSHARED= gcc -shared
  CCSHARED= -fpic
  LINKFORSHARED=-Xlinker -export-dynamic
  
--- 123,129 
  RANLIB=   ranlib
  MACHDEP=  freebsd3
  SO=   .so
! LDSHARED= gcc -shared -fpic -pthread 
  CCSHARED= -fpic
  LINKFORSHARED=-Xlinker -export-dynamic
  
***
*** 209,217 
cp -ra test debian mx PoPy-1.4.1/
tar czf PoPy-1.4.1.tar.gz PoPy-1.4.1/
  
-   
- 
  # Rules appended by makedepend
  
  PoPymodule.o: $(srcdir)/PoPymodule.c; $(CC) $(CCSHARED)  $(CFLAGS) -c 
$(srcdir)/PoPymodule.c
! PoPymodule$(SO):  PoPymodule.o; $(LDSHARED)  PoPymodule.o  -L/usr/local/pgsql/lib/ 
-lpq -o PoPymodule$(SO)
--- 209,215 
cp -ra test debian mx PoPy-1.4.1/
tar czf PoPy-1.4.1.tar.gz PoPy-1.4.1/
  
  # Rules appended by makedepend
  
  PoPymodule.o: $(srcdir)/PoPymodule.c; $(CC) $(CCSHARED)  $(CFLAGS) -c 
$(srcdir)/PoPymodule.c
! PoPymodule$(SO):  PoPymodule.o; $(LDSHARED) PoPymodule.o  -L/usr/local/pgsql/lib 
-lpq $(LIBS) -o PoPymodule$(SO)






___
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] Wampum generator on Zope 2.2.4 fails / _isBeingUsedAsAMethod

2000-12-03 Thread Steve Spicklemire


Hmm.. I *know* I've seen this before. I think it was when I was trying
to move ZClasses that were *created* under Zope 2.2.0+ to Zope 2.1.x.
Are you sure you're working with 100% 2.2.4?

-steve

 "Brad" == Brad Clements [EMAIL PROTECTED] writes:

Brad Selecting the Security Tab on a Wampum Generator produces
Brad this output:

Brad Error Type: AttributeError Error Value:
Brad _isBeingUsedAsAMethod


Brad Traceback (innermost last): File
Brad /usr/holmes/Zope/lib/python/ZPublisher/Publish.py, line 222,
Brad in publish_module File
Brad /usr/holmes/Zope/lib/python/ZPublisher/Publish.py, line 187,
Brad in publish File
Brad /usr/holmes/Zope/lib/python/Zope/__init__.py, line 221, in
Brad zpublisher_exception_hook (Object: CyberCash) File
Brad /usr/holmes/Zope/lib/python/ZPublisher/Publish.py, line 171,
Brad in publish File
Brad /usr/holmes/Zope/lib/python/ZPublisher/mapply.py, line 160,
Brad in mapply (Object: manage_access) File
Brad /usr/holmes/Zope/lib/python/ZPublisher/Publish.py, line 112,
Brad in call_object (Object: manage_access) File
Brad /usr/holmes/Zope/lib/python/AccessControl/Role.py, line 252,
Brad in manage_access (Object: Traversable) AttributeError: (see
Brad above)


Brad Any ideas?

Brad Brad Clements, [EMAIL PROTECTED] (315)268-1000
Brad http://www.murkworks.com (315)268-9812 Fax netmeeting:
Brad ils://ils.murkworks.com AOL-IM: BKClements

Brad ___ Zope
Brad maillist - [EMAIL PROTECTED]
Brad http://lists.zope.org/mailman/listinfo/zope ** No cross
Brad posts or HTML encoding!  ** (Related lists -
Brad http://lists.zope.org/mailman/listinfo/zope-announce
Brad http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Installation and Startup

2000-12-02 Thread Steve Spicklemire


Norm... 'services' is an NT concept. Just run the bat file from the
command line.

-steve
 "Norm" == Norm LaDuke [EMAIL PROTECTED] writes:

Norm I have installed Zope on a 300Mhz K6 machine with 92 Megs of
Norm RAM running Windows 98. It seemed to install ok except that
Norm it didn't ask if I wanted to run as a service (as the
Norm documentation said it would). As a result I had to start
Norm zope with start.bat. It doesn't run. Who in the world can I
Norm talk to about this. I'd love to use the product but it's not
Norm much use to me if there's no one I can communicate with
Norm about problems - particularly problems like "It doesn't
Norm run!".

Norm   Can anyone suggest a place for me to go or a
Norm way to get answers?



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] mysql zope

2000-11-30 Thread Steve Spicklemire


Hi  Ruediger,

You might consider ZPatterns. It allows you to develop
applications with ZODB, and then, later, 'easily' switch to
other forms of attribute storage for your objects.

-steve

 "Alexander" == Alexander DePauli [EMAIL PROTECTED] writes:

Alexander Hi Zopistas!

Alexander we are looking for a method to do a better integration
Alexander of mysql 3.23.27 with zope 2.2.2. (we are using the Z
Alexander MySQL database adapter Z MySQL DA 1.1.3.)

Alexander We have to store data in a mysql database - we can´t
Alexander use ZODB because we need the data accessible by other
Alexander programs via ODBC.

Alexander We habe implemented several ZClasses like "customer",
Alexander "product" and "orders".  We store their instances
Alexander (eg. each product, customer and so on) to the
Alexander mysql-database.

Alexander Our problem: we can´t use the standard ZOPE management
Alexander interface to manage the objects, because the methods of
Alexander this interface store content to the ZODB - and not to
Alexander the mysql-database.

Alexander Is there a way to extend the standard ZOPE management
Alexander interface with additional mysql statements?  For
Alexander example: we select an object in a zope folder, press
Alexander the ZOPE Delete-Button, then this object is deleted on
Alexander the mysql-database, not on the ZODB?

Alexander For each zclass (customer, products, orders) we need
Alexander these extra methods (Delete, Update, Insert ...), so
Alexander our thought is that we would prefer to use the ZOPE
Alexander management interface to do this instead of programming
Alexander "extra methods" which obviously can't be used within
Alexander the standard ZOPE management interface.

Alexander Hope there is somebody out there with an similarly
Alexander problem solved.

Alexander best regards

Alexander Ruediger ~
Alexander http://www.herrenausstatter.de - Der
Alexander Online-Herrenausstatter Kostenlose Serviceline: 0800
Alexander -999 66 33 Versandkostenfreie Lieferung - 30 Tage
Alexander Rückgaberecht ~
Alexander Verwaltungsadresse: DePauli.com Aktiengesellschaft
Alexander Stahlgruberring 3 - 81829 München Telefon: 089 / 530 75
Alexander 170 - Telefax 089 / 514 50 666

Alexander ___ Zope
Alexander maillist - [EMAIL PROTECTED]
Alexander http://lists.zope.org/mailman/listinfo/zope ** No cross
Alexander posts or HTML encoding!  ** (Related lists -
Alexander http://lists.zope.org/mailman/listinfo/zope-announce
Alexander http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] strange behaviour of ZSQL methods

2000-11-29 Thread Steve Spicklemire



How about:

dtml-var "theQuery(REQUEST=REQUEST, src__=1)"

-steve

 "Oliver" == Oliver Bleutgen [EMAIL PROTECTED] writes:

 Hi listies,

 something strange is happening with my ZSQL methods. I have a
 huge query that works great when testing it in the
 management-interface - it returns about 10 records or so.  but
 when I implement it into a dtml-method getting the parameters
 via X-Y-GMX: $flush REQUEST as usual, I am getting the whole
 database in return.  I'm quite sure that it's my own fault, so
 I'd like to see the translated SQL-query in the dtml-method to
 check for the wrong fields. Is there a tag for it like:
 dtml-var MyZSQLQuery showRenderedSQLsource ?

Oliver You didn't tell what SQL-Database you use, but Postgres
Oliver and Mysql allow logging/monitoring of the queries they
Oliver get. So you are able to get the information straight
Oliver before/while it hits the backend.

Oliver cheers, oliver

Oliver ___ Zope
Oliver maillist - [EMAIL PROTECTED]
Oliver http://lists.zope.org/mailman/listinfo/zope ** No cross
Oliver posts or HTML encoding!  ** (Related lists -
Oliver http://lists.zope.org/mailman/listinfo/zope-announce
Oliver http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Editing SQL methods from Emacs (+ FTP server)?

2000-11-29 Thread Steve Spicklemire


 I'm trying to get a list of lists using ZSQL Methods...
 
 I have two related tables, hounds and items.
 
 I want to get the hound_id in items like this but can't work out how to pass
 the hound_id variable...
 
 dtml-in get_hounds
 
 bdtml-var name dtml-var id/b
 
 dtml-in "get_items(hound_id='id')"

dtml-in "get_items(hound_id = id)"

should work. Be careful... id is an unfortunate field name for your
database.. there may be a namespace collision with the Zope notion of
id. If this turns out to be a problem, post again and we can suggest
some work-arounds 

-steve

 dtml-var titlebr
 
 /dtml-in
 /dtml-in
 
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists - 
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )
 

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] ZopeWeaver?

2000-11-28 Thread Steve Spicklemire


Hi Andy,

 "Andy" == Andy McKay [EMAIL PROTECTED] writes:

 There are now all manner of Dreamweaver extensions, both

Andy I tried it briefly and found that Dreamweaver cant seem to
Andy handle a file with no extension such as index_html, so gave
Andy up.

Yes.. it's apparently just the Windows version that has this
problem it's a really wierd limitation... 

-steve


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope-dev] Re: ZPatterns getPersistentItemIDs() bug?

2000-11-27 Thread Steve Spicklemire


Hi Chris,

   It looks like it's a non-bug, more just an annoyance. Here's my current
feeling. In most 'real' situations you'll end up with a ZCatalog, or possibly
a totally virtual ZClass with some sort of dynamic (SQL? LDAP? etc.. ) 
data source where the ids you're after will be queried for.  My own practice
at this point is to define methods at the rack level like:

getAllItemIds, getRejectedItemIds, getCurrentItemIds 

and so on. These can then be implemented in a way that matches the
actual data storage. *If* the data is stored persistently, and *if*
you are implementing 'getAllItemsIds' and *if* you don't have a handy
ZCatalog around to query, then you can use the hack I sent Roche. ;-)
Otherwise there are better ways to do it anyway. The reason it's a
probem is that getPersistentItemIDs() returns a BTree object, that
isn't allowed to be exposed directly by the security
machinery. However, 'sort' short-curcuits the machinery so that you
can 'handle' them (in this hack, you store them in a simple python
list). Anyway..  it's not clear it's a bug worth fixing... if it's
a bug at all.

-steve

 "Chris" == Chris Withers [EMAIL PROTECTED] writes:

Chris Steve Spicklemire wrote:
  This is a known problem. Use:
 
 dtml-let itemIDs="[]" dtml-in
 "addressRack.getPersistentItemIDs()" sort dmtl-call
 "itemIDs.append(_['sequence-item'])" /dtml-in

Chris Hmmm... that's not very nice, has the bug in
Chris getPersistentItemIDs() been fixed?

Chris cheers,

Chris Chris




___
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] Create Virtual DataSkin

2000-11-27 Thread Steve Spicklemire


Hmm... since triggers are done at transaction commit time, could
it be that the 'change' trigger doesn't happen if the change
occurs on the same transaction as an 'add'?

-steve

 "bentzion" == bentzion  [EMAIL PROTECTED] writes:

bentzion This simple issue is driving me crazy...  I am trying to
bentzion create a DataSkin with some Properties in a MySQL
bentzion database. So I have an ID, NAME, and DESCRIPTION that is
bentzion in REQUEST and using:

bentzion dtml-let ni="newItem(key=REQUEST['key'])"
bentzion nips="ni.propertysheets.get('Basic')" dtml-call
bentzion "nips.manage_changeProperties(REQUEST=REQUEST)"
bentzion /dtml-let

bentzion The item gets created but the Properties are not
bentzion changed.

bentzion Can someone please post the ADD/CHNAGE Trigger syntax
bentzion and accompanying ZSQL Methods for a simple creation of a
bentzion DataSkin ZClass.

bentzion Much appreciated.


___
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] RE: BSD 4 installation

2000-11-25 Thread Steve Spicklemire


Hi Lee,

   I'm not sure if this will help.. but I do know that I routinely build
Zope on multiple FreeBSD systems and it has never caused a problem like this.
Did you build your own python, or use a port? What flavor of BSD? I've never
had to edit Makefile.pre.in or do.py on FreeBSD 3.x, or 4.x.

-steve

 "Webmaster" == Webmaster  [EMAIL PROTECTED] writes:

Webmaster I haven't solved my BSD problem but I did discover that
Webmaster there are BSD ports of Zope and Zope products
Webmaster maintained at
Webmaster http://www.freebsd.org/cgi/ports.cgi?query=zopestype=all

Webmaster I haven't been able to get the port to work yet but I
Webmaster suspect that it's because I don't have root access to
Webmaster the server.

Webmaster That will have to wait till Monday when the *senior*
Webmaster tech support guys are on duty. I called my webhost tech
Webmaster support last night and I happened to ask which version
Webmaster of BSD they used. The 'technician' replied, and I
Webmaster quote: "BSD? What does that do? I've never heard of
Webmaster it."

Webmaster I pointed out that BSD was the version of Unix on all
Webmaster his host servers.

Webmaster At least he made me feel like less of Unix newbie.

Webmaster :)

Webmaster Lee Hunter Hum Communications Ltd.

 -Original Message- From: Lee Hunter
 [mailto:[EMAIL PROTECTED]] Sent: November 24, 2000 3:50 PM To:
 '[EMAIL PROTECTED]' Subject: BSD 4 installation
 
 
 I'm trying to build Zope on a BSD server.
 
 According to the install.txt I have to run two commands -
 "python w_pcgi.py" and "./start".
 
 I managed to get the first command to run (python w_pcgi.py)
 after editing my Makefile.pre.in and do.py as per the FAQ.txt.
 
 But when I when I run the second command (./start) I get the
 following error message:
 
 media2: {38} % ./start Traceback (innermost last): File
 "/magma/users/u21/wake/zope/z2.py", line 554, in ?  exec
 "import "+MODULE in {} File "string", line 1, in ?  File
 "/magma/users/u21/wake/zope/lib/python/Zope/__init__.py", line
 94, in ?  import ZODB, ZODB.ZApplication, imp File
 "/magma/users/u21/wake/zope/lib/python/ZODB/__init__.py", line
 85, in ?  import sys, ExtensionClass, TimeStamp, cPersistence,
 Persistence ImportError: No module named ExtensionClass
 
 Any ideas as to what I'm doing wrong?
 
 TIA
 
 Lee Hunter Hum Communications Ltd.
 
 


Webmaster ___ Zope
Webmaster maillist - [EMAIL PROTECTED]
Webmaster http://lists.zope.org/mailman/listinfo/zope ** No cross
Webmaster posts or HTML encoding!  ** (Related lists -
Webmaster http://lists.zope.org/mailman/listinfo/zope-announce
Webmaster http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] how to get the created table names

2000-11-24 Thread Steve Spicklemire


Hmm.. I think there is a method of a ZSQL result object called 'names'.. 

Here is a snippet from some working code:

dtml-let specificTypes="getTypes(ttid=type, name='', tttype='')"
  theNames="specificTypes.names()"

where 'getTypes' is a ZSQL Method and theNames is the list of column names returned
from the query...

-steve

 "Jose" == Jose Soares [EMAIL PROTECTED] writes:

Jose There isn't a SQL standard command to show the tables in the
Jose database.  Thus evry database has a different command to do
Jose such job.  For example:

Jose DBMaker: to show TABLES: select * from SYSTABLE to show
Jose COLUMNS: SELECT COLUMN_NAME,TYPE_NAME,PRECISION FROM
Jose SYSCOLUMN WHERE TABLE_NAME='table_name' MySQL: to show
Jose TABLES: SHOW TABLES to show COLUMNS: DESC table_name
Jose PostreSQL: to show TABLES: select tablename from pg_tables
Jose where tablename not like 'pg_%' to show COLUMNS: SELECT
Jose a.attname, t.typname, CASE WHEN a.attlen  0 THEN attlen
Jose ELSE a.atttypmod END as length FROM pg_class c, pg_attribute
Jose a, pg_type t WHERE c.relname = 'table_name' AND a.attnum 
Jose 0 AND a.attrelid = c.oid AND a.atttypid = t.oid


Jose I wrote a couple of ZSQL Methods to emulate a generic ISQL
Jose to query a database using the SQL language which shows the
Jose names of every table in the database and every column name,
Jose type and length of every table.  If you want I can send you
Jose it.


Jose José

Jose subrahmanyan kalathur wrote:

 hi,
 
 I would like to know the names of the created table in zsql
 method.  Kindly give me the tag for displaying the table
 names.( if exists.)
 
 thanks bye yours,
 
 K.H.Subrahmanyan
 
 ( [EMAIL PROTECTED] )
 
 ___ Zope maillist -
 [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No
 cross posts or HTML encoding!  ** (Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )


Jose ___ Zope
Jose maillist - [EMAIL PROTECTED]
Jose http://lists.zope.org/mailman/listinfo/zope ** No cross
Jose posts or HTML encoding!  ** (Related lists -
Jose http://lists.zope.org/mailman/listinfo/zope-announce
Jose http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope-dev] Method calls

2000-11-23 Thread Steve Spicklemire


Hi Roch,

   The whole traceback would be helpful.. one clue:

Error Type: TypeError
Error Value: hasattr, argument 2: expected string, int found

'hasattr' is the function that is complaining do you use
it in your code? 

-steve
 "Roch'e" == Roch'e Compaan [EMAIL PROTECTED] writes:

Roch'e I have a method called getModulesForProduct to which I
Roch'e pass a ProductID eg: dtml-in
Roch'e "Products.Modules.getModulesForProduct(this(), _,
Roch'e ProductID)" sort=name

Roch'e If ProductID is passed on from a form variable it works
Roch'e fine.

Roch'e If I set the ProductID through REQUEST.set: dtml-call
Roch'e "REQUEST.set('ProductID',_.str(Product.id))" ,

Roch'e I get a TypeError:

Roch'e Error Type: TypeError Error Value: hasattr, argument 2:
Roch'e expected string, int found

Roch'e I've been banging my head against this problem the whole
Roch'e day so help would really be appreciated.

Roch'e Roché






Roch'e ___ Zope-Dev
Roch'e maillist - [EMAIL PROTECTED]
Roch'e http://lists.zope.org/mailman/listinfo/zope-dev ** No
Roch'e cross posts or HTML encoding!  ** (Related lists -
Roch'e http://lists.zope.org/mailman/listinfo/zope-announce
Roch'e http://lists.zope.org/mailman/listinfo/zope )


___
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] Method calls

2000-11-23 Thread Steve Spicklemire


Hmm... OK ... next question... what are you doing *in* the 'in' tag?

Somehow you're trying to access an object contained in an
object manager (one of your modules?) and you're using an
'int' rather than a string as an id. Can you post the code?

thanks,
-steve

 "Roch'e" == Roch'e Compaan [EMAIL PROTECTED] writes:

 OK.. it's the 'in' tag that's causing the problem. Why not try:
 
 dtml-var "experession that's causing problem with in"
 html_quote
 
 and see what 'in' is choking on...

Roch'e It's choking on a list of instances.  This is what is
Roch'e returned when I "var" the expression:

Roch'e [Module instance at 8b97660, Module instance at
Roch'e 88f04b0, Module instance at 8994730, Module instance
Roch'e at 8b46a08]


___
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] New ZPatterns example... was Re: [Zope] New releases of Zwiff and ZCVSMixin...

2000-11-23 Thread Steve Spicklemire


Urp.. yes. sorry! 

Thanks!
-steve

 "Rik" == Rik Hoekstra [EMAIL PROTECTED] writes:

  OK.. The new ZPatterns Example is up there  now off to fix
 some EMarket problems

Rik for which the secret url is:
Rik http://www.zope.org/Members/sspickle/DumbZPatternsExample

Rik I hope you don't mind me re veiling it ;-)

Rik Rik


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Problems with new Todo example.

2000-11-23 Thread Steve Spicklemire


Hmmm... er.. it's just page with a picture and some text there's
nothing zopey at all... I (almost) never run IE or Windowsso
I'll dig around here and see if I can reproduce it it's wierd
though.. it's just simple html! 

Does the app part work for you?

-steve

 "jimbo" == jimbo  [EMAIL PROTECTED] writes:

jimbo When I try to access the link on the index_html page, to
jimbo see what the Zope structure looks like, it crashes IE 4 on
jimbo win98.  Any thing special going on there in
jimbo zopeStructure.html?  -Jimbo




___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope-dev] ZPatterns: Methods of specialits

2000-11-22 Thread Steve Spicklemire


Hi Roch'e,

   I'm guessing that getAllContactsForCustomer is a "DTML Method".  If
I remember correctly the third argument is a 'mapping object' that can
be used to augment the effective namespace available to the
method. Passing _.None should do nothing (I'm guessing you could just
use "getAllContactsForCustomer( this(), _ )" and it would work just
fine. This issue has been pretty much hashed to death here in the 
past. There is even a fishbowl proposal to 'fix it'. 

http://dev.zope.org/Wikis/DevSite/Proposals/NamespacePassingRevisited

-steve

 "Roch'e" == Roch'e Compaan [EMAIL PROTECTED] writes:

Roch'e I have a specialist Contacts and for Contacts I have a
Roch'e method getAllContactsForCustomer.  Whenever I want to call
Roch'e this method I have to pass on the whole namespace and the
Roch'e object itself to get it to work eg:
Roch'e getAllContactsForCustomer(this(), _, _.None).  Why is this
Roch'e the case?  And what does _.None actually mean?

Roch'e 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 Project Help!

2000-11-22 Thread Steve Spicklemire


Hi Ben,

   GAPs are sort of deprecated at this point in favor
of SkinScript. In SkinScript you might do something like this:


WITH accounts.getItem(self.account_id) COMPUTE account_object=RESULT

or more carefully...

WITH accounts.getItem(self.account_id) COMPUTE account_object=(RESULT is _.None) and 
NOT_FOUND or RESULT

-steve

 "bentzion" == bentzion  [EMAIL PROTECTED] writes:

bentzion Another question...

bentzion I want to have a GAP that will add some other Object to
bentzion an attribute of my DataSkin. This is what I have tried
bentzion with no success.

bentzion fromexpr: accounts.getItem(self.account_id) attrsexprs:
bentzion account_object=RESULT

bentzion This way in my UI Methods in my DataSkin I can access
bentzion (and change) the attributes of "account_object".

bentzion Q. How can I do this? Should I be doing this in a
bentzion different/better way?

bentzion Thanks, -Ben


___
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] New releases of Zwiff and ZCVSMixin...

2000-11-22 Thread Steve Spicklemire


For those who are paying attention ;-)   there are new releases of
Zwiff and ZCVSMixin at zope.org. There will be a new DumbZPatternsExample
later today or tomorrow...

The Zwiff release has been updated with the latest patches of ming and
now has lots of working examples. You download the examples, and the source
files (fonts, sounds, pics etc... ) for the examples separately.

ZCVSMixin just has a minor bug fix about comments in CVS log files.

DumbZPatternsExample now has three interacting Specialists and better
separation of UI, Domain and Implementation stuff 

cheers,
-steve


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




  1   2   >