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

2000-12-13 Thread Itai Tavor

Hi,

I have a Specialist ('OrderingEntities') which creates virtual 
objects, mapped to existing objects (using ZClass 'Employee') in 
another Specialist ('Employees'). I want OrderingEntities to add and 
modify a property 'current_order_id' on the Employee objects. I can 
get the virtual object to access properties from the real object, but 
I can't figure out how to implement the property add/change.

To make things simpler, I added the property current_order_id to the 
Employee class, so I can test just modifying this property, leaving 
creating it for later.

OrderingEntities has an employeeRack, set to use the Employee class 
and to load by accessing attribute current_order_id. The Rack has 
this SkinScript:

 WITH Employees.getItem(self.id) COMPUTE
 original_object=RESULT or NOT_FOUND

 WITH self.original_object COMPUTE
 current_order_id

 WHEN OBJECT ADDED,CHANGED STORE current_order_id USING
 
self.original_object.manage_changeProperties(current_order_id=self.current_order_id)

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

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

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

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

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

"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-dev] Validation

2000-12-13 Thread Chris Withers

Brad Clements wrote:
 
 I keep making this patch to each Zope release, but would like to talk
 about a more permanant and "correct" solution. What do others think?

Validation as a whole could do with looking at, it's be great if there
were hooks to catch validation problems rather than just raising
exceptions...

cheers,

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 )




[Zope-dev] Re: [Zope] ANNOUNCE: Zope 2.3.0 alpha 1 released...

2000-12-13 Thread Lalo Martins

Found a bug, I think... when I try to add a property to a
PropertyManager (but not a PropertySheet?) I get:

Error Type: ImportError
Error Value: cannot import name checkValidId

Traceback (innermost last):
  File /opt/Zope-2.3.0a1-src/lib/python/ZPublisher/Publish.py,
line 222, in publish_module
  File /opt/Zope-2.3.0a1-src/lib/python/ZPublisher/Publish.py,
line 187, in publish
  File /opt/Zope-2.3.0a1-src/lib/python/Zope/__init__.py, line
221, in zpublisher_exception_hook
(Object: Traversable)
  File /opt/Zope-2.3.0a1-src/lib/python/ZPublisher/Publish.py,
line 171, in publish
  File /opt/Zope-2.3.0a1-src/lib/python/ZPublisher/mapply.py,
line 160, in mapply
(Object: manage_addProperty)
  File /opt/Zope-2.3.0a1-src/lib/python/ZPublisher/Publish.py,
line 112, in call_object
(Object: manage_addProperty)
  File /opt/Zope-2.3.0a1-src/lib/python/OFS/PropertyManager.py,
line 318, in manage_addProperty
(Object: Traversable)
  File /opt/Zope-2.3.0a1-src/lib/python/OFS/PropertyManager.py,
line 247, in _setProperty
(Object: Traversable)
ImportError: (see above)


[]s,
   |alo
   +
--
  Hack and Roll ( http://www.hackandroll.org )
The biggest site for whatever-it-is-that-we-are.


http://zope.gf.com.br/lalo   mailto:[EMAIL PROTECTED]
 pgp key: http://zope.gf.com.br/lalo/pessoal/pgp

Brazil of Darkness (RPG)--- http://zope.gf.com.br/BroDar


___
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] Re: [Zope] ANNOUNCE: Zope 2.3.0 alpha 1 released...

2000-12-13 Thread Brian Lloyd

 Found a bug, I think... when I try to add a property to a
 PropertyManager (but not a PropertySheet?) I get:
 
 Error Type: ImportError
 Error Value: cannot import name checkValidId

Thanks - the fix should be checked in shortly...


Brian Lloyd[EMAIL PROTECTED]
Software Engineer  540.371.6909  
Digital Creations  http://www.digicool.com 




___
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] python 2.0, windows and zope

2000-12-13 Thread Andy McKay

Has anyone got python 2.0 working with Zope on windows? Just curious if
anyone has any pointers before I start done this (potentially) painful
path...

--
  Andy McKay, Developer.
  ActiveState.


___
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] python 2.0, windows and zope

2000-12-13 Thread Josh Zeidner


Ive successfully installed the latest version of zope on windows and have it
running my website.  http://www.brooklynmedialabs.com .  Its actually easier
than running it on linux!

 -josh



Has anyone got python 2.0 working with Zope on windows? Just curious if
anyone has any pointers before I start done this (potentially) painful
path...

--
  Andy McKay, Developer.
  ActiveState.


___
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] python 2.0, windows and zope

2000-12-13 Thread Andy McKay

using python 2.0 and not the default python installation?
--
  Andy McKay, Developer.
  ActiveState.

- Original Message -
From: "Josh Zeidner" [EMAIL PROTECTED]
To: "Andy McKay" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, December 13, 2000 9:18 AM
Subject: RE: [Zope-dev] python 2.0, windows and zope



 Ive successfully installed the latest version of zope on windows and have
it
 running my website.  http://www.brooklynmedialabs.com .  Its actually
easier
 than running it on linux!

  -josh



 Has anyone got python 2.0 working with Zope on windows? Just curious if
 anyone has any pointers before I start done this (potentially) painful
 path...

 --
   Andy McKay, Developer.
   ActiveState.


 ___
 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] ZPatterns: persistant objects hold DataSkin-Items - KeyError: _v_dm_

2000-12-13 Thread Ulrich Eck

after one more day of source-code-reading i got that far:

When I want to use a Folder /w Customizer (FwCS) I cannot/don't need to use
Specialists.

i create a FwCS and put my 'Framework' in it.
if i want to access (get/new) an object handled by a customizer
i can ask FwCS._getDataManagerFor(client,default) for my datamanager (DM)

Do I need to implement methods like
createItem/retrieveItem/_v_itemConstructor as well
or how do i "get" my objects ??

If I have an object whose metatype is handled via
customizer/skinscript/sqlmethod it'll
probably work managing attributes ..

I'm searching for something that handles a newItem(meta_type,key) function
that is provided
from the FwCS who decides which object-type is created and gets those
attributes from the customizer

did I get this right so far ??

is there an example those newItem(meta_type,key) -
getItem(meta_type,key) ??


thanks
Ulrich Eck

 
 a) tell my TransactionManager that my attribute "ds_object" is not
pickeable
 (e.g. call it  _v_ds_object)
  and how to know if zope is restarted ?!?!?
 or
 b) store this object persistantly in my TO without showing it in the
 folder-structure but behave like a DSO
  set/get attributes through Skinscripts

 Yes.  Use a Folder w/Customization Support above your transactions.  When
 you access TO.ds_object, the DataSkin will search for a DataManager and
 find one in the FwCS, assuming you've configured one.

 Note that this is mutually exlcusive to using Specialists to store the
 DataSkins.  In the FwCS approach, you configure Customizers for each
 meta_type of objects you'll be dealing with.  You can then give them
 SkinScript, etc. to configure behaviors.  Also, this approach requires use
 of the ZODB to store at least the "shell" (class reference and ID) of each
 DataSkin.  But since your application is ZODB-dependent already, this is
 not an issue.

 Personally, I'd suggest that if you want to take advantage of ZPatterns'
 database independence, you should instead restructure your app so that
your
 TO's are themselves DataSkins, stored in a Specialist.  Right now, you
have
 a very heavy dependence on the ZODB.



___
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: persistant objects hold DataSkin-Items - KeyError: _v_dm_

2000-12-13 Thread Phillip J. Eby

At 06:31 PM 12/13/00 +0100, Ulrich Eck wrote:
after one more day of source-code-reading i got that far:

When I want to use a Folder /w Customizer (FwCS) I cannot/don't need to use
Specialists.

Not to store your objects, no.  You can still use Specialists to
concentrate search methods, constructors, UI snippets, and the like.
Typically, in that configuration some of your Specialists may contain (or
be) ZCatalogs which index selected objects from your FwCS hierarchy.


i create a FwCS and put my 'Framework' in it.
if i want to access (get/new) an object handled by a customizer
i can ask FwCS._getDataManagerFor(client,default) for my datamanager (DM)

Not necessary.  If you retrieve your DataSkin as an attribute of its
container, the DataSkin __of__ method will automatically find and bind the
DataManager (assuming you're not using some class that overrides __of__).


Do I need to implement methods like
createItem/retrieveItem/_v_itemConstructor as well
or how do i "get" my objects ??

Just retrieve the objects from their containers in the normal Zope way.
Ditto for creation - use the standard way of constructing objects in an
ObjectManager.


If I have an object whose metatype is handled via
customizer/skinscript/sqlmethod it'll
probably work managing attributes ..

Yes, it should.  Likewise triggers, if you want to set up cataloging triggers.


I'm searching for something that handles a newItem(meta_type,key) function
that is provided
from the FwCS who decides which object-type is created and gets those
attributes from the customizer

Just use the normal Zope "add list" to create one manually, or call the
appropriate constructors (e.g. SomeZClass.createInObjectManager()).


is there an example those newItem(meta_type,key) -
getItem(meta_type,key) ??

You want examples?  You forget, this is ZPatterns.  ;)  Seriously, look for
examples of how to create an object by meta_type in a Zope ObjectManager.


___
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] ZClass registry repair utility

2000-12-13 Thread Shane Hathaway

I've written a utility you can use to clean up the global registry of
ZClasses.  The registry can become corrupt through product upgrades--not
ZODB corruption, but missing base classes and so forth.  This utility
recreates the registry.

http://www.zope.org/Members/hathawsh/ZGlobalsRepair

It's probably a good idea to run it after a major Zope upgrade.

Shane

___
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] python 2.0, windows and zope

2000-12-13 Thread Andy McKay

Waffling on to my own posts... but it would seem I have to build Zope from
source to get it to use another version of python since the use of
python15.dll is entrenched in Zope... All the install scripts seem to be
based on unix.

Can DC give me a hand here on pointers to how they build it for Windows?

--
  Andy McKay, Developer.
  ActiveState.

- Original Message -
From: "Andy McKay" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, December 13, 2000 9:21 AM
Subject: Re: [Zope-dev] python 2.0, windows and zope


 using python 2.0 and not the default python installation?
 --
   Andy McKay, Developer.
   ActiveState.

 - Original Message -
 From: "Josh Zeidner" [EMAIL PROTECTED]
 To: "Andy McKay" [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Wednesday, December 13, 2000 9:18 AM
 Subject: RE: [Zope-dev] python 2.0, windows and zope


 
  Ive successfully installed the latest version of zope on windows and
have
 it
  running my website.  http://www.brooklynmedialabs.com .  Its actually
 easier
  than running it on linux!
 
   -josh
 
 
 
  Has anyone got python 2.0 working with Zope on windows? Just curious if
  anyone has any pointers before I start done this (potentially) painful
  path...
 
  --
Andy McKay, Developer.
ActiveState.
 
 
  ___
  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 )



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




[Zope-dev] zPoPyDA and DB Transactions

2000-12-13 Thread Casey Duncan

I had been using Postgres with the zPyGreSQLDA and recently switched to
zPoPyDA for a new project. I noticed that zPoPyDA does not seem to
implicitly wrap each zSQL method in a database transaction as
zPyGreSQLDA did.

Reading the code for zPoPyDA seems to confirm this. Is this behavior by
design or a bug or am I missing something? 

-- 
| Casey Duncan
| Kaivo, Inc.
| [EMAIL PROTECTED]
`--

___
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] python 2.0, windows and zope

2000-12-13 Thread Brian Lloyd

 Waffling on to my own posts... but it would seem I have to build Zope from
 source to get it to use another version of python since the use of
 python15.dll is entrenched in Zope... All the install scripts seem to be
 based on unix.
 
 Can DC give me a hand here on pointers to how they build it for Windows?

Hi Andy - 

We have a little python script that creates NMAKE compatible 
makefiles out of the Setup files. I've attached it + the .bat 
file we use to run it. Hope this helps!


Brian Lloyd[EMAIL PROTECTED]
Software Engineer  540.371.6909  
Digital Creations  http://www.digicool.com 





'''Build t Python extension using Visual C++ 40

This script generates and runs a series of .mak and .def
files for extensions defined in a Setup file.

Note that you must have set up your environment to run VC command-line
ustilities.  This can be done by running the vcvar32.bat file in the
VC++ bin directory.

Usage: python ext.py [options]

Options:

   -r Run nmake to build release version
   -d Run nmake to build debug version
   -c If used with -r or -d, runs nmake on clean target.
   -p Specify location of Python source tree.  Default
  is ..\.. (assuming you are in Extensions/some_name)

The script reads a file named "Setup" in the current directory.  The
Setup file has lines that describe the contents of an extension.
Here\'s an example:

  ExtensionClass ExtensionClass.c
  Acquisition Acquisition.c

Note that I\'ve intented for readability.  The Setup file shouldn\'t
be indented.  Basically, the first token on the line is the module
name, and the second token on the line is the sorce file. Additional
source files and include directories may be included as well, as in:

  pyexpat pyexpat.c -DXML_NS -Iexpat/xmlparse -Iexpat/xmltok expat/xmlparse/xmlparse.c 
expat/xmlparse/hashtable.c expat/xmltok/xmlrole.c expat/xmltok/xmltok.c


''' # '

import sys, getopt, os, string, regex

def die(m):
print m
print
print __doc__
sys.exit(1)

def setup():

poptlist,pargs=getopt.getopt(sys.argv[1:],'p:drcI:o:h')
if opt(poptlist,'h'): print __doc__
if poptlist==[('-h','')]: sys.exit(0)

pargs and die('Unrecognized arguments: %s', string.join(args))

ext_regex = regex.compile('\([a-z][a-z0-9_]*\)[ \t]'
  '\([.a-z][./a-z0-9_]*[.]c\)[ \t\n]',
  regex.casefold)

for line in open('Setup').readlines():

if ext_regex.match(line) = 0:
sargs=string.split(line)
module=sargs[0]
src=sargs[1]
if src[:2]=='./': continue
soptlist, sargs = getopt.getopt(sargs[2:],'I:D:')

filter(lambda a: a[:1]=='-' or string.find(a,'.')  0,
   sargs) and die('Invalid arguments in Setup file: %s' %
  string.join(sargs))

sargs=map(lambda a: string.replace(a, '/','\\'), sargs)
simple(module,poptlist+soptlist, sargs)


main=setup

def filebase(o,
 splitext=os.path.splitext,
 split=os.path.split):
return splitext(split(o)[1])[0]



def simple(module,optlist,others):
tdef,tmak=templates()

pyhome=opt(optlist,'p')
pyhome=pyhome and pyhome[0] or '..\\..'
cfg=opt(optlist,'d') and 'Debug' or 'Release'
parms={'module': module, 'pyhome':pyhome, 'cfg': cfg}
parms['includes']=string.join(
map(lambda i: '/I "%s"' % i,
opt(optlist,'I')) +
map(lambda i: '/D "%s"' % i,
opt(optlist,'D'))
, ' ') 
parms['other_clean_release']=string.join(
map(lambda o:
'\n\t-@erase ".\\Release\\%s.obj"' % filebase(o),
others),'')
parms['other_clean_debug']=string.join(
map(lambda o:
'\n\t-@erase ".\\Debug\\%s.obj"' % filebase(o),
others),'')
parms['other_rule']=string.join(
map(lambda o:
'"$(INTDIR)\%s.obj" : .\%s $(DEP_CPP_MOD) "$(INTDIR)"\n'
'\t$(CPP) $(CPP_PROJ)  .\%s '
% (filebase(o), o, o),
others),'\n')
parms['other_link']=string.join(
map(lambda o:
'\n\t"$(INTDIR)\%s.obj" \\' % filebase(o),
others),'')

open(module+'.def','w').write(tdef % parms)
open(module+'.mak','w').write(tmak % parms)
cfg_=' CFG="%s - Win32 %s"' % (module,cfg)
os.system('nmake /nologo /f %s.mak%s' % (module,cfg_))
os.system('copy %s\%s.dll %s.pyd' % (cfg,module,module))
if opt(optlist,'c'):
os.system("nmake /f %s.mak%s CLEAN" % (module,cfg_))



def opt(optlist,name):
l=filter(lambda t, name='-'+name: t[0]==name, optlist)
return map(lambda t: t[1], l)

def templates():
tdef = '''EXPORTS
init%(module)s
'''

tmak = '''# Microsoft Developer Studio Generated NMAKE File, Format Version 4.00
# ** DO NOT EDIT **

# TARGTYPE "Win32 (x86) Dynamic-Link Library" 

Re: [Zope-dev] python 2.0, windows and zope

2000-12-13 Thread Andy McKay

I think thats just the fella I need! Thanks...
Will let you know progress
--
  Andy McKay, Developer.
  ActiveState.

- Original Message -
From: "Brian Lloyd" [EMAIL PROTECTED]
To: "Andy McKay" [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Wednesday, December 13, 2000 11:14 AM
Subject: RE: [Zope-dev] python 2.0, windows and zope


  Waffling on to my own posts... but it would seem I have to build Zope
from
  source to get it to use another version of python since the use of
  python15.dll is entrenched in Zope... All the install scripts seem to be
  based on unix.
 
  Can DC give me a hand here on pointers to how they build it for Windows?

 Hi Andy -

 We have a little python script that creates NMAKE compatible
 makefiles out of the Setup files. I've attached it + the .bat
 file we use to run it. Hope this helps!


 Brian Lloyd[EMAIL PROTECTED]
 Software Engineer  540.371.6909
 Digital Creations  http://www.digicool.com





___
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] Announcing ZODB-Corba code release

2000-12-13 Thread John D. Heintz

Here is the first release of code that exposes a ZODB database through
CORBA (omniORB).

The code is functioning, the docs are sparse, and it should work on your
machines.  ;-)

I am only going to be in town for the next two days, then I will be
unavailable until Jan 1.

See http://www.zope.org/Members/jheintz/ZODB_CORBA_Connection to
download the code.

It's not perfect, but it works for me.

Enjoy,
John


-- 
.. . . . . . . . . . . . . . . . . . . . . . . .

John D. Heintz | Senior Engineer

1016 La Posada Dr. | Suite 240 | Austin TX 78752
T 512.633.1198 | [EMAIL PROTECTED]

w w w . d a t a c h a n n e l . c o m


___
Bug reports, feature requests, etc. go in the ZEO Tracker:
http://www.zope.org/Products/ZEO/Tracker

Conversations etc. can take place in the Wiki:
http://www.zope.org/Products/ZEO/Wiki

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





___
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 Itai Tavor

Steve Spicklemire wrote:

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

Gr now I'm really annoyed. Why didn't I try that? So obvious. Thanks.


 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.

Sounds like a good plan, think I'll adopt it.


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

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


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

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

"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-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-dev] Validation

2000-12-13 Thread Michael Bernstein

Chris Withers wrote:
 
 Brad Clements wrote:
 
  I keep making this patch to each Zope release, but would like to talk
  about a more permanant and "correct" solution. What do others think?
 
 Validation as a whole could do with looking at, it's be great if there
 were hooks to catch validation problems rather than just raising
 exceptions...

 Along with the TTW ability to define new variable types to
be validated (and their validation methods), such as :email,
:12hTime, :24hTime, :URL, :fqURL (fully qualified URL), and
others.

Michael Bernstein.

___
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: persistant objects hold DataSkin-Items - KeyError: _v_dm_

2000-12-13 Thread weblabs


 Not necessary.  If you retrieve your DataSkin as an attribute of its
 container, the DataSkin __of__ method will automatically find and bind the
 DataManager (assuming you're not using some class that overrides __of__).


ok i've gone all through the source searching for a method
to get an object of a meta-type with key ...

when I call FwCS.getOb(id) then i get back an object with ??meta-type??
if I have different Customizers all serving one meta-type ???

example:
I Have a Customizer for an EventClass and another for LocationClass

they're both stored in an database using an unique int as PrimaryKey

when i call getOb(1) how should my FwCS know which one it should
give back ??

 Just retrieve the objects from their containers in the normal Zope way.
 Ditto for creation - use the standard way of constructing objects in an
 ObjectManager.
 Just use the normal Zope "add list" to create one manually, or call the
 appropriate constructors (e.g. SomeZClass.createInObjectManager()).


Yes, if i create an object and call FwCS._setObject(id,ob) the FwCS can
choose the right place to store the object
e.g. if properly configured using a Customizer with SSMethod


 is there an example those newItem(meta_type,key) -
 getItem(meta_type,key) ??

 You want examples?  You forget, this is ZPatterns.  ;)  Seriously, look
for
 examples of how to create an object by meta_type in a Zope ObjectManager.


just the one snippet of code which how to serve the problem i described ..

thanks again for your appropriate help

Ulrich Eck


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