[Zope-dev] The test suite is not registered in setup.py of zope.datetime

2010-09-17 Thread Robin Lee
The test suite is not registered in setup.py of zope.datetime

Robin
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] The test suite is not registered in setup.py of zope.i18n

2010-09-16 Thread Robin Lee
The test suite is not registered in setup.py of zope.i18n.

Robin
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Will zope.testing 3.10 be included in ZTK 1.0 final?

2010-09-15 Thread Robin Lee
Will zope.testing 3.10 be included in ZTK 1.0 final?

And the test suite is not registered in setup.py in zope.testing 3.9 branch.

Robin
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Tests of zope.dottedname not actually run

2010-09-12 Thread Robin Lee
Hello, all.

When I run the test through 'python setup.py test', it shows:

$ python setup.py test
running test
running egg_info
writing requirements to src/zope.dottedname.egg-info/requires.txt
writing src/zope.dottedname.egg-info/PKG-INFO
writing namespace_packages to
src/zope.dottedname.egg-info/namespace_packages.txt
writing top-level names to src/zope.dottedname.egg-info/top_level.txt
writing dependency_links to
src/zope.dottedname.egg-info/dependency_links.txt
reading manifest file 'src/zope.dottedname.egg-info/SOURCES.txt'
writing manifest file 'src/zope.dottedname.egg-info/SOURCES.txt'
running build_ext
/usr/lib/python2.6/site-packages/zope/testing/doctest/__init__.py:104:
DeprecationWarning: zope.testing.exceptions is deprecated in favour of
zope.testrunner.exceptions
  from zope.testing.exceptions import DocTestFailureException
/home/cheese/Downloads/zope/zope.dottedname-3.4.6/src/zope/dottedname/tests.py:19:
DeprecationWarning: zope.testing.doctest is deprecated in favour of the
Python standard library doctest module
  from zope.testing.doctest import DocFileSuite,REPORT_NDIFF,ELLIPSIS

--
Ran 0 tests in 0.000s

OK


So no test seems run.
I have Python 2.6.4 and zope.testing 3.10.0, and added
test_suite='zope.dottedname' to setup.py.


Robin
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] test_suite missed in setup.py in zope.conttenttype

2010-09-12 Thread Robin Lee
This is trivial.


python-zope-contenttype-3.5.1-run-tests.patch
Description: Binary data
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] How can I make the tests of zope.sqlalchemy running?

2010-09-12 Thread Robin Lee
The output of a failed 'python setup.py test' is attached.
$ python setup.py test
running test
running egg_info
writing requirements to src/zope.sqlalchemy.egg-info/requires.txt
writing src/zope.sqlalchemy.egg-info/PKG-INFO
writing namespace_packages to 
src/zope.sqlalchemy.egg-info/namespace_packages.txt
writing top-level names to src/zope.sqlalchemy.egg-info/top_level.txt
writing dependency_links to src/zope.sqlalchemy.egg-info/dependency_links.txt
reading manifest file 'src/zope.sqlalchemy.egg-info/SOURCES.txt'
writing manifest file 'src/zope.sqlalchemy.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
  File setup.py, line 36, in module
'pysqlite',
  File /usr/lib/python2.6/distutils/core.py, line 152, in setup
dist.run_commands()
  File /usr/lib/python2.6/distutils/dist.py, line 975, in run_commands
self.run_command(cmd)
  File /usr/lib/python2.6/distutils/dist.py, line 995, in run_command
cmd_obj.run()
  File /usr/lib/python2.6/site-packages/setuptools/command/test.py, line 137, 
in run
self.with_project_on_sys_path(self.run_tests)
  File /usr/lib/python2.6/site-packages/setuptools/command/test.py, line 117, 
in with_project_on_sys_path
func()
  File /usr/lib/python2.6/site-packages/setuptools/command/test.py, line 146, 
in run_tests
testLoader = loader_class()
  File /usr/lib/python2.6/unittest.py, line 816, in __init__
self.parseArgs(argv)
  File /usr/lib/python2.6/unittest.py, line 843, in parseArgs
self.createTests()
  File /usr/lib/python2.6/unittest.py, line 849, in createTests
self.module)
  File /usr/lib/python2.6/unittest.py, line 613, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
  File /usr/lib/python2.6/unittest.py, line 587, in loadTestsFromName
return self.loadTestsFromModule(obj)
  File /usr/lib/python2.6/site-packages/setuptools/command/test.py, line 34, 
in loadTestsFromModule
tests.append(self.loadTestsFromName(submodule))
  File /usr/lib/python2.6/unittest.py, line 576, in loadTestsFromName
module = __import__('.'.join(parts_copy))
ValueError: Empty module name
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope] Re: Question about Zope and security

2006-03-29 Thread George Lee
  I'd rather encrypt passwords with a hash and reset the password if the 
  users have lost it. Is it possible to do that in Zope?

Isn't there an option in GRUF to encrypt passwords?

Although I don't think that affects the user's sending of passwords over the 
Web.

Peace,
George

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


[Zope] Re: major problems placing authentication on an extranet site-security flaw?

2006-02-11 Thread George Lee
michael nt milne [EMAIL PROTECTED] writes:

 HiI have major problems here trying to set-up authentication over a
 whole Plone site using Zope.

I'm not going to get involved in the large Zope security discussion but I will
post an additional something to plone-users in reply to the more narrow problem.
If you want additional help with it there, we'll need more details and debugging
from you. I usually like to help folks figure out bugs because it's a nice
problem solving stint, but I can't do much without more info.

Peace,
George

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


[Zope] Re: major problems placing authentication on an extranet site-security flaw?

2006-02-11 Thread George Lee
Scratch that, looking more closely at the thread it looks like you followed the
make site private documentation and it worked.

Peace,
George

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


[Zope] SOLUTION -- Products have incorrect home attribute

2006-01-19 Thread George Lee
 After migrating to a new server, several of my Zope products have an
 incorrect home attribute that specifies where they live on the
 filesystem. However, when I try to change these attributes using an
 external method, the attributes do not change. Any help?
 
 Peace,
 George


Turns out it was a bug in my external method, writing == instead of =, that
tripped me up. This is the external method I used:



OLD_INSTANCE_PROD_DIR_LIST = [
   '/home/BLUH1/zope/instance1/Products/',
   '/home/BLUH2/zope/instance1/Products/',
   ]
NEW_INSTANCE_PROD_DIR = '/usr/local/zope/instance1/Products/'

OLD_PYTHON_PROD_DIR_LIST = [
   '/usr/home/BLUH3/zope/270/lib/python/Products/',
   '/home/BLUH4/zope/273/lib/python/Products/',
   '/home/BLUH5/zope/281/lib/python/Products/',
   ]
NEW_PYTHON_PROD_DIR = '/usr/local/zope/284/lib/python/Products/'

def listHome(self):
   prods = self.Control_Panel.Products
   listBefore = []
   listAfter = []

   for p in prods.objectIds():
  homeBefore = prods._getOb(p).home
  listBefore = listBefore + [homeBefore]
  if homeBefore in map( lambda x : x + p, OLD_INSTANCE_PROD_DIR_LIST ):
 prods._getOb(p).home = NEW_INSTANCE_PROD_DIR + p
  elif homeBefore in map( lambda x : x + p, OLD_PYTHON_PROD_DIR_LIST ):
 prods._getOb(p).home = NEW_PYTHON_PROD_DIR + p
  listAfter = listAfter + [prods._getOb(p).home]

   return Before: %s\n\nAfter: %s % (str(listBefore),str(listAfter))

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


[Zope] Re: Products have incorrect home attribute

2006-01-18 Thread George Lee
 I asked the same question a couple of days ago (see wrong directoy in 
 Control_Panel.Products..home) and no, they aren't reset at zope 
 restart, and deleting the pyc files doesn't help either.

Thanks, didn't see the previous conversation. =)

I'll do the delete the Products objects trick ... any idea why it fails to just
directly change the attribute with an external method? I'm not savvy to the
inner workings of ZODB so I don't know if there's read-only attributes or
persistence issues (with a string attribute though?) here...


Peace,
Geroge

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


[Zope] Re: Newbee interfaces and implementations

2006-01-18 Thread George Lee
 So you recommend that I should just skip them as long as I'm on Zope2?
 
 I would be happy with that. I find them confusing when they don't
 really interface with but just document my methods.

Some of the reasons interfaces can be helpful are (1) for documentation purposes
and clarity for code if someone needs to look at it, (2) if other classes might
use the same interface, you help make sure you're sticking to a common interface
so that the methods in different classes do similar things, and (3) you can use
methods like isImplementedBy so that certain templates, code, etc. does
something with an object or class if it uses the interface -- what you call
really interfacing.

There's many examples of how (3) might work. It seems like for now that (3)
won't be important to you and (2) might be. Personally I define interfaces for
some classes (especially tools) to help with the documentation, but agree with
you that for other straightforward classes they don't help that much with
documetnation.

Hope this helps; peace,
George

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


[Zope] Products have incorrect home attribute

2006-01-17 Thread George Lee
After migrating to a new server, several of my Zope products have an
incorrect home attribute that specifies where they live on the
filesystem. However, when I try to change these attributes using an
external method, the attributes do not change. Any help?

Peace,
George
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] External Methods, Proxy Roles, and Executable Security

2005-11-20 Thread George Lee
Great, thanks much.

Is there much buzz about this in CMF developer land? It seems like
proper proxy roles handling, and like you said what Zope 3 security
will do to it, are pretty important and will come up quite often (all
I was doing, after all, was trying to move an object upon workflow
change!).

Peace,
George


On 11/19/05, Dieter Maurer [EMAIL PROTECTED] wrote:
 George Lee wrote at 2005-11-19 00:46 -0500:
 In CMFCore 1.5.4:
 
 If a low-security-clearance user calls an external method that pastes
 an object from a PortalFolder, he gets an error because the following
 line in CMFCore.PortalFolder fails:
 
 if not sm.checkPermission(DeleteObjects, parent):
raise AccessControl_Unauthorized
 
 This is even the case if sm.checkPermission is changed to
 _checkPermission, which takes into account proxy roles. The external
 method does not allow proxy roles attached, so I can't just add a
 Manager proxy role.
 
 Because I called the pasting in an external method, I expected it to
 go through without security problems! Is this a right expectation /
 and a bug, or a wrong expectation?

 It is the fate induced by explicit security checks.
 It will get much worse when the Zope 3 security comes into
 Zope 2 land: then even trusted code will have to deal with
 security proxied objects.


 We currently work around the problem that trusted code
 cannot have proxy roles with the following class:

 class ProxyContext:
   def __init__(self, proxy_roles):
 self._proxy_roles = tuple(proxy_roles)

   def getOwner(self): return None
   getWrappedOwner = getOwner

 This class emulates an object with proxy roles and can be pushed
 onto the SecurityManagers context stack like so:

 sm = getSecurityManager()
 context = ProxyContext(proxy_roles)
 sm.addContext(context)
 try:
 # do something with proxy_roles
 ...
 finally: sm.removeContext(context)


 Note, that I had to fix (in a local copy) CMF's _checkPermission
 for this to work:

It had decided to emulate Zope's proxy role checking only
approximately -- incorrectly for a None owner.

 My fix looks like this:

 security.declarePrivate('_checkPermission')
 def _checkPermission(permission, obj):
  Check if the current user has the permission on the given object.
 
 # this code is ported from ZopeSecurityPolicy.checkPermission
 roles = rolesForPermissionOn(permission, obj)
 if isinstance(roles, basestring):
 roles = [roles]
 context = getSecurityManager()._context

 # check executable owner and proxy roles
 # this code is ported from ZopeSecurityPolicy.validate
 stack = context.stack
 if stack:
 eo = stack[-1]
 owner = eo.getOwner()
 if owner is not None:
 if not owner.allowed(obj, roles):
 return 0
 # DM 2005-09-07: no reason to do it differently from Zope
 #   It accepts proxy_roles even for a None owner
 ##proxy_roles = getattr(eo, '_proxy_roles', None)
 ##if proxy_roles:
 ##if obj is not aq_base(obj):
 ##if not owner._check_context(obj):
 ##return 0
 ##for r in proxy_roles:
 ##if r in roles:
 ## return 1
 ##return 0
 proxy_roles = getattr(eo, '_proxy_roles', None)
 if proxy_roles:
 if obj is not aq_base(obj):
 # DM 2005-09-07: do it as Zope does
 #if not owner._check_context(obj):
 if owner is not None and not owner._check_context(obj):
 return 0
 for r in proxy_roles:
 if r in roles:
  return 1
 return 0

 return context.user.allowed(obj, roles)


 If you are interested in using this approach, you
 should probably file another CMF bug report about the
 wrong handling of proxy roles in _checkPermission.
 I explicitely allow you to attach the fix given above.


 --
 Dieter

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


[Zope] Reprise -- Manager Proxy Role ineffective for deleting/moving objects

2005-11-18 Thread George Lee
I forget if I submitted a collector issue about this before, but I
didn't see it. I just posted one at
http://www.zope.org/Collectors/CMF/396:

Title: PortalFolder.py _verifyObjectPaste ignores executable security

Version info: CMF 1.5.4 but also in trunk

_verifyObjectPaste calls sm.checkPermission(permission_name,self)
rather than _checkPermission(permission_name,self)

This makes it ignore executable security. So, if _verifyObjectPaste is
in an external method or in a script with sufficient proxy roles, it
raises an Unauthorized error for users when the external method /
proxy role security should suffice.



On 9/9/05, Dieter Maurer [EMAIL PROTECTED] wrote:
 George Lee wrote at 2005-9-8 23:57 -0400:
  ...
 Is it okay to just replace sm.checkPermission with _checkPermission
 from CMFCore.utils or is that not okay?

 Yes. But, please file a bug report as well.

 Also Dieter I noticed that Alan Runyan and you briefly discussed this
 issue back in 2002:
 http://mail.zope.org/pipermail/zope-cmf/2002-September/015350.html

 Any internal use should always take executable security (i.e.
 executable ownership and proxy roles) into account.
 Not doing so is a but, as things expected to be possible are not
 and (maybe even worse) things expected to be impossible may
 be possible.

 There may be a need for application code to check the permissions
 of the user with proxy roles not taken into account.

   E.g. a script that must use a Manager roles to do one
   thing but does not want to do another unless the current
   user has specific permissions.

 For this case, there also should be a method checking
 permissions with proxy roles not taken into account.

 --
 Dieter

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


[Zope] External Methods, Proxy Roles, and Executable Security

2005-11-18 Thread George Lee
In CMFCore 1.5.4:

If a low-security-clearance user calls an external method that pastes
an object from a PortalFolder, he gets an error because the following
line in CMFCore.PortalFolder fails:

if not sm.checkPermission(DeleteObjects, parent):
   raise AccessControl_Unauthorized

This is even the case if sm.checkPermission is changed to
_checkPermission, which takes into account proxy roles. The external
method does not allow proxy roles attached, so I can't just add a
Manager proxy role.

Because I called the pasting in an external method, I expected it to
go through without security problems! Is this a right expectation /
and a bug, or a wrong expectation?

Peace,
George







On 11/18/05, George Lee [EMAIL PROTECTED] wrote:
 I forget if I submitted a collector issue about this before, but I
 didn't see it. I just posted one at
 http://www.zope.org/Collectors/CMF/396:

 Title: PortalFolder.py _verifyObjectPaste ignores executable security

 Version info: CMF 1.5.4 but also in trunk

 _verifyObjectPaste calls sm.checkPermission(permission_name,self)
 rather than _checkPermission(permission_name,self)

 This makes it ignore executable security. So, if _verifyObjectPaste is
 in an external method or in a script with sufficient proxy roles, it
 raises an Unauthorized error for users when the external method /
 proxy role security should suffice.



 On 9/9/05, Dieter Maurer [EMAIL PROTECTED] wrote:
  George Lee wrote at 2005-9-8 23:57 -0400:
   ...
  Is it okay to just replace sm.checkPermission with _checkPermission
  from CMFCore.utils or is that not okay?
 
  Yes. But, please file a bug report as well.
 
  Also Dieter I noticed that Alan Runyan and you briefly discussed this
  issue back in 2002:
  http://mail.zope.org/pipermail/zope-cmf/2002-September/015350.html
 
  Any internal use should always take executable security (i.e.
  executable ownership and proxy roles) into account.
  Not doing so is a but, as things expected to be possible are not
  and (maybe even worse) things expected to be impossible may
  be possible.
 
  There may be a need for application code to check the permissions
  of the user with proxy roles not taken into account.
 
E.g. a script that must use a Manager roles to do one
thing but does not want to do another unless the current
user has specific permissions.
 
  For this case, there also should be a method checking
  permissions with proxy roles not taken into account.
 
  --
  Dieter
 

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


Re: [Zope] VIRTUAL_URL Failure

2005-11-09 Thread George Lee
Two main questions:
  (1) Does anybody *have* good documentation on VIRTUAL_URL and how it
interacts with CookieCrumbler and VirtualHostMonster?
  (2) Does anyone know how to debug VirtualHostMonster or other Python
libraries while running a Zope instance (it lives in Python not in
Zope, so I don't know if I change the code there if those changes will
actually get executed)?



For people who care to read more about what I think is going on:

 Well, where is VIRTUAL_URL documented? Why doesn't Plohn do something
 sane if it's not there?

It's not Plone's issue from what I can tell. CookieCrumbler, which
lives in CMF, does do something sane if VIRTUAL_URL is not there -- it
tries to create a substitute URL.

VIRTUAL_URL is set by the VirtualHostMonster. Does anyone know how to
debug it? Because it is in the python directories used to build Zope,
not in a Zope product which I know how to debug. (Is there a way to
restart python to register changes in VirtualHostMonster.py)?

Here is what I can tell of what is going on:

(1) VIRTUAL_URL is supposed to return the actual URL when there is a
Virtual Hosting Monster, for instance http://subdomain.mydomain.org
instead of http://ip:port/path/to/subdomain/object or
http://mydomain.org/path/to/subdomain/object.

(2) There's an Apache rewrite rule set to transform URL requests like
http://subdomain.org to
http://ip:port/VirtualHostBase/http/subdomain.mydomain.org before they
get sent into Zope.

(3) When VirtualHostMonster receives a request like
http://ip:port/VirtualHostBase/http/subdomain.mydomain.org, it is
supposed to return the currect object at
http://ip:port/path/to/subdomain/object and set a variable VIRTUAL_URL
http://subdomain.mydomain.org in the REQUEST variable.

(4) When navigating to an authenticated-only page, CMFCore's
CookieCrumbler sets a came_from variable to remember where to go. To
set the came_from variable, it first looks for VIRTUAL_URL. If it
doesn't find it, it uses another method to set came_from -- but this
returns an URL, and one that does not work.

(5) During login in Plone to a authenticated-only page, it uses
CMFCore's CookieCrumbler came_from variable.






  I'm wondering if CookieCrumbler is supposed
  to set VIRTUAL_URL given that there's a VHM installed and doesn't?

 It's probably some code in the publisher or vhm. Maybe it's something
 that didn't get merged from a branch or the trunk.

 Your best bet is to come up with minimal (ie: no plone, no cookie
 crumbler, etc) way to reproduce this and file a bug report in the collector.

 Oh, and grab yourself a copy of grep and see where this should be
 defined ;-)

 cheers,

 Chris

 --
 Simplistix - Content Management, Zope  Python Consulting
 - http://www.simplistix.co.uk


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


Re: [Zope] VIRTUAL_URL Failure

2005-11-09 Thread George Lee
   (2) Does anyone know how to debug VirtualHostMonster or other Python
 libraries while running a Zope instance (it lives in Python not in
 Zope, so I don't know if I change the code there if those changes will
 actually get executed)?

Oh wait it is in a Zope product, scratch that.


Peace,
George
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: VIRTUAL_URL Failure

2005-11-09 Thread George Lee
 The correct thing to use in a recent Zope is REQUEST['ACTUAL_URL'].

 Florent


This gives something like http://ip:port/path/to/subdomain though
rather than http://subdomain.mydomain.org ... what if anything gives
the latter?


Peace,
George
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: VIRTUAL_URL Failure

2005-11-09 Thread George Lee
 I fear you fight a CookieCrumbler bug.

Vicious monsters, indeed.

Thanks for the REQUEST['URL'] tip. It's a pretty good workaround for
now, although not exactly right. If I am going to an object

http://here.org/object

with default page or default method default, then REQUEST['URL'] equals

http://here.org/object/default

instead of

http://here.org/object

This works for purposes of redirecting after login but isn't exactly
what should happen. From what I recall browsing a few ACTUAL_URL, etc.
threads, this is one reason there's a difference between the few
different URL variables.

Also, I opened up a collector issue at
  http://www.zope.org/Collectors/CMF/393

Peace,
George



 The most natural REQUEST['URL'] will give the correct value
 (as it gives what the primary HHTP cleint sees).

 --
 Dieter

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


Re: [Zope] VIRTUAL_URL Failure

2005-11-08 Thread George Lee
Zope 2.8.1

In Plone 2.1.1, when I try to access a page Anonymous does not have
permission to see, it redirects to a login. While doing so, it sets a
came_from variable with the URL I'm trying to access. It sets an ugly

http://my.domain.org/VirtualHostBase/http/my.domain.org:80/contentPages

which does not work. Plone folks suspected this was a Zope problem.

When Plone sets the came_from, it draws on the REQUEST variable. It
first looks to see if there is a VIRTUAL_URL in the REQUEST variable,
but it doesn't find one. I'm wondering if CookieCrumbler is supposed
to set VIRTUAL_URL given that there's a VHM installed and doesn't?

Peace,
George



Peace,
George



On 11/8/05, Chris Withers [EMAIL PROTECTED] wrote:
 George Lee wrote:
  On my Plone site, in CookieCrumbler.py, VIRTUAL_URL is not found in
  the request variable even though I have a Virtual Host Monster. This
  means that when logging in, the came_from URL that my site directs
  to becomes something ugly like

 What version of Zope are you using?

 Why do you think VIRTUAL_URL should be there?

 cheers,

 Chris

 --
 Simplistix - Content Management, Zope  Python Consulting
 - http://www.simplistix.co.uk

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


[Zope] VIRTUAL_URL Failure

2005-11-04 Thread George Lee
Hi,

On my Plone site, in CookieCrumbler.py, VIRTUAL_URL is not found in
the request variable even though I have a Virtual Host Monster. This
means that when logging in, the came_from URL that my site directs
to becomes something ugly like

http://my.domain.org/VirtualHostBase/http/my.domain.org:80/contentPages

This doesn't seem to be an Apache rewriting issue.

Should VIRTUAL_URL be found in the request variable and giving the
right URL (http://my.domain.org/contentPages), and why isn't it
showing up?

Peace,
George
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-dev] dtml-in batching badly

2001-06-18 Thread LEE, Kwan Soo

No it's not a bug(in code) but a feature.
May You call it a bug (in usability), though.

What causes it is that the orphan value defaults to 3 when not explicitely set.

See the online help for in tag.

LEE Kwan Soo
¢—ƒzùšŠYb²Öh¥àÞ¿:)zŠà†Ûiÿùb²Û3¢—¨®æj)fjåŠËbú?Ί^uëÍ¡Êè²Êh²Û(¬tÌ-éܡا¥jם–+-²m§ÿåŠËlΊ^¢¸?™¨¥™©ÿ–+-Šwèÿ:)y©ç¢éÜzm§ÿåŠËlΊ^¢¸?™¨¥™©ÿ–+-Šwèÿ:)


[Zope] Loading ZMySQLda on Solaris 7

2001-01-30 Thread Lee Marzke


Hi,

After having no problems at all with Zope 2.3, and Mysql on Linux RedHad6.1
I tried getting this to work on a Solaris 7 SPARC machine with no luck.

Im using:

Solaris 7 (SunOS 5.7 )
GCC 2.95.1
Zope 2.3.0 
ZMySQLDA 1.2 
MySQL 3.22.32  compiled from source
Python 1.5.2, Python 1.6, Python2.0  all compiled with thread support.

When I try to load a ZMySQL object in Zope I keep getting the following
error:  Any ideas?

Thanks,


ImportError: ld.so.1: python: fatal: relocation error: file
/sw/scm/usr/lib/python1.5/site-packages/_mysql.so: symbol PyTuple_New:
referenced symbol not found


Traceback (innermost last):
  File
"/sw/scm/usr/Zope-2.3.0-solaris-2.6-sparc/lib/python/OFS/Application.py", line
530, in import_products
product=__import__(pname, global_dict, global_dict, silly)
  File
"/sw/scm/usr/Zope-2.3.0-solaris-2.6-sparc/lib/python/Products/ZMySQLDA/__init__.
py", line 106, in ?
import sys, os, Globals, DA
  File
"/sw/scm/usr/Zope-2.3.0-solaris-2.6-sparc/lib/python/Products/ZMySQLDA/DA.py",
line 108, in ?
from db import DB
  File "/usr/share/zope/lib/python/Products/ZMySQLDA/db.py", line 106, in ?
ImportError: ld.so.1: /sw/scm/usr/Zope-2.3.0-solaris-2.6-sparc/bin/python:
fatal: relocation error: file
/sw/scm/usr/Zope-2.3.0-solaris-2.6-sparc/lib/python/Products/ZMySQLDA/_mysqlmodu
le.so: symbol PyObject_Init: referenced symbol not found



ee Marzke [EMAIL PROTECTED] 30-Jan-01, 15:10:04
Kulicke  Soffa Industries
2101 Blair Mill Rd   +1 215 784-6217
Willow Grove, PA 19090   +1 215 784-6014 fax


___
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] migration issues - 2.2.4 - 2.30

2001-01-28 Thread Lee

Hi there,

I've been developing an application on Win32 using Zope 2.2.4 and a
Gadfly database. Now that I've got a working prototype I will me
rebuilding my app on Zope 2.3 in Unix using a MySQL database...
tomorrow. I expect the process won't be a simple job i.e. copying 
pasting *won't* do the trick ;-)

I just have a few questions about the problems I expect to run into:

1- Python methods/scripts. In changing my python methods to python
scripts will I need to make any drastic changes or will they perform
just the same if I have the *exact* same content in them?

2- MySQL DBA. I'm not responsible for installing Zope or the MySQL DBA
on the Unix machine but from what I understand, people have had a few
problems working with MySQL DBA. What problems can I expect?

3- I would like to backup what I have done on my home machine and copy
it to another windows machine at uni (that I can reference when I'm
building on the Unix version). I don't have access to the Unix machine
from outside uni so, apart from copying the source into text files, is
there a way I can *copy* Zope's files and place them on another machine?

Hmm...

I expect I'll be bombarding the list with questions these coming weeks.

Thanks in advance for any information/advice you can offer.

- Best regards,

Lee



___
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] a little problem - $1 reward!

2001-01-25 Thread Lee

Hi there,

If someone could have a quick look at this I would really appreciate it!
I cannot for the life of me understand this... I have a DTML method
taking in parameters for use with sendmail, which when I *display*
appear correct but when I *send* are altered slightly. I know where the
problem lies (it's obvious) but I can't see what the problem is.

Here's my DTML method:

dtml-var standard_html_header
dtml-call "REQUEST.set('recipients',[])"
  dtml-in "REQUEST.form.items()"
dtml-if expr="_['sequence-key'] in
('message','sender','senderEmail','subject')"
  input type="hidden" name="dtml-var sequence-key"
value="dtml-var sequence-item"
dtml-else
  dtml-call "recipients.append(_['sequence-key'])"
/dtml-if
  /dtml-in

dtml-sendmail mailhost="MailHost"
  To: dtml-var "_.string.join(recipients,'@cs.strath.ac.uk,
')"@cs.strath.ac.uk
  From: dtml-var sender 
  Reply-To: dtml-var senderEmail
  Subject: dtml-var subject
  X-Mailer: ZAPHOD Mail Client V1.0

  dtml-var message

/dtml-sendmail

h2Cheers, dtml-var sender!/h2
  pYour message has been sent./p

^
My problem lies with the To/From parts in the sendmail. When the
message has been sent...

-=-==--=-= I should see:

Subject:  Hello
Date: Thu, 25 Jan 2001 08:30:11 +
From: Lee
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]

-=-==--=-= but I see:

Subject:  Hello
Date: Thu, 25 Jan 2001 08:30:11 +
From: [EMAIL PROTECTED]  why is the @cs.strath.ac.uk still
appended?
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]

dtml-var sender gives me 'Lee'

Clearly, there is a problem with :
To: dtml-var "_.string.join(recipients,'@cs.strath.ac.uk,
')"@cs.strath.ac.uk
From: dtml-var sender 

i.e the @cs.strath.ac.uk is still lingering... but why? without the
'@cs.strath.ac.uk' at the end of the var the last email address would
not be complete i.e. it be "lreilly".

even when i put another tag in place of from, e.g. 'X-Mailer:' is still
renders From='[EMAIL PROTECTED]'. I know it's asking a lot but can
anyone tell me what the problem is? I'm confused and the coffee isn't
helping anymore!

- Thanks,

Lee

--
Lee Reilly
mailto:[EMAIL PROTECTED]

````

HAVE SKILLS; WILL TRAVEL.

I'm currently looking for an internship in the USA
in the field of web development. Ideally, I'm looking
for a placement for 3 to 18 months. Can you help?

More details, my resume, etc. @
http://homepages.strath.ac.uk/~aeu97172/

/shameless plug


___
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] a little problem - $1 reward!

2001-01-25 Thread Lee

Hi,

Thanks for your response. "dtml-var sender" gives me...

    From: "Lee"@cs.strath.ac.uk

... in the received message. A previous version I had of this script gave
me the correct results (From: God, Reply-To: [EMAIL PROTECTED]) so I'm
pretty-sure that's it's a problem with '@cs.strath.ac.uk' being appended.

As far as I can tell, the new version is doing exactly the same thing only
using a collection of recipients and python's string_join. H...

The virtual buck is still here!

Thanks,

Lee

"M. Adam Kendall" wrote:

 Lee,
 This is more than likely your mailer doing this, not Zope.
 try:
   From: "dtml-var sender"

 Notice the quotes around the dtml-var sender

--
Lee Reilly
mailto:[EMAIL PROTECTED]

````

HAVE SKILLS; WILL TRAVEL.

I'm currently looking for an internship in the USA
in the field of web development. Ideally, I'm looking
for a placement for 3 to 18 months. Can you help?

More details, my resume, etc. @
http://homepages.strath.ac.uk/~aeu97172/

/shameless plug



___
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] a little problem - $1 reward!

2001-01-25 Thread Lee

 DON'T HAVE ANY WHITESPACE BEFORE THE MAIL HEADERS. (sorry for the shouting,
 but it's a classic misstake)

I didn't realise that. Thanks.

 Does it work "DTMLless". I.e. does it work with statically typed in email
 addresses and such?

Nope, 'From:Lee' still gives me [EMAIL PROTECTED] in the received message.

 And you are running with the same mailserver, on the same host?

Yup. Here's a little example of a mail program (some might call it an email
spammer perhaps) to help me apply for some jobs. This is also why I wanted to
know if sendmail could be used for usenet postings...

dtml-var standard_html_header

dtml-sendmail mailhost="MailHost"
To: dtml-var email
From: Lee Reilly
Reply-To: [EMAIL PROTECTED]
X-Mailer: Job Spammer
Subject: dtml-var position practical training/internship position
Content-Type: multipart/mixed; boundary="138879291FA1FC8B06755CEE"

This is a multi-part message in MIME format.
--138879291FA1FC8B06755CEE
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

--138879291FA1FC8B06755CEE
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Base: "http://homepages.strath.ac.uk/~aeu9717
2/"
Content-Location: "http://homepages.strath.ac.uk/~aeu9717
2/"

html
head
titleLee Reilly/title
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"

meta name="description" content="seeking employment in the US for a period of 3
months starting in June 2001"

   meta name="keywords" content="lee, reilly, internship, web site, website,
BUNAC, summer, work, employment, Scottish, Lee Reilly"

/head

body bgcolor="#FF" text="#CCFFCC" link="#CC" vlink="#CC"
alink="#CC"
pfont color="#00" size="2" face="Arial, Helvetica, sans-serif"Dear
dtml-var name, /font/p
pfont color="#00" size="2" face="Arial, Helvetica, sans-serif"Further
  to you advertisement on dtml-var advertisement I am writing to enquire as to
whether you have any summer
  internship / practical training opportunities available for Computer Science
  graduates this summer. I am due to graduate with a BSc Hons degree in Computer

  Science in June 2001 from the University of Strathclyde, Glasgow, and from
there ... blah blah blah

/body
/html

--138879291FA1FC8B06755CEE--

/dtml-sendmail
h2Cheers big yin!/h2
pYou'll get the job ;-)/p
dtml-var standard_html_footer

This gives me the *correct* results so I can't imagine that's a problem with the
mailserver:

Subject: web developer practical training/internship position
Date: Thu, 25 Jan 2001 14:08:55 +
From:  Lee Reilly  - perfect!
Reply-To: [EMAIL PROTECTED]
To:  [EMAIL PROTECTED]

So I think it's a problem with
To: dtml-var "_.string.join(recipients,'@cs.strath.ac.uk,')"@cs.strath.ac.uk

It's now more trouble than it's worth so I'll just implement it differently.
It's quite annoying though!

Thanks for your help anyway :)

- Best regards,

Lee



___
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] zope + img tags + javascript

2001-01-24 Thread Lee

Hi there,

I'm using JavaScript primarily for form evaluation, multiple submit
buttons and various other piece of client-sided trickery but I've
encountered a problem. I've seen something similar mentioned before but
I can't find it in my archive.

I *hate* image maps but I'd like to use one so  how can I add the
details to the dtml-var imageName? I'd also like to add various bits
'n bobs of JavaScript to some of the images that I am using. Adding img
src="http://hostname:8080/exactLocation" is not a possible alternative
for me.

Can anyone help?

The similar previous post that I am referring to concerned the resizing
of images in DTML. If someone could tell me how to do this then I expect
I could adapt it to reference my image map. I think it would be possible
to take in the var and pass it to a python method, which would then
alter it and pass it back... but surely there's an easier way?

Thanks very much for your time  thanks in advance if you can help.

- Best regards,

Lee

--
Lee Reilly
mailto:[EMAIL PROTECTED]

````

HAVE SKILLS; WILL TRAVEL.

I'm currently looking for an internship in the USA
in the field of web development. Ideally, I'm looking
for a placement for 3 to 18 months. Can you help?

More details, my resume, etc. @
http://homepages.strath.ac.uk/~aeu97172/

/shameless plug




___
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] dtml-let + 'expr=' possible?

2001-01-23 Thread Lee

Hi,

I have one quick question about the 'let' tag;

dtml-var expr="classcode_to_table(classcode)" gives me the value
'class52225'. Is there anyway I can use the 'let' tag to push this onto
the namespace stack? I was thinking something *like*;

dtml-let table expr="classcode_to_table(classcode)"

The python method, classcode_to_table, takes in a string, alters it
and returns it. This is going to be an argument for some ZSQL methods
and some Python methods.
        
Thanks,

Lee


___
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] Alternating Row Colors

2001-01-22 Thread Darin Lee

Lee,

Alternating row colors are very easy in Zope because of the variables 'sequence-odd' 
and 'sequence-even' defined by the dtml-in tag.

A super quick example:

table bgcolor="#ff"
dtml-in some_list
 tr dtml-if sequence-oddbgcolor="#EE"/dtml-if
   tdYour cell data here/td
 /tr
/table

You can code variations on this to get what you need.

-Darin




___
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] python method's self parameter - calling from DTML with additional args

2001-01-22 Thread Lee

Hi,

I've got a problem with displaying output from one of my python methods,
which has 'self' as one of its input parameters. I have a DTML method,
which sets up a table using one Python method to create the table
headers (the first row) and another Python method to create the table
data (one row per result set). I think my problem can be solved (maybe)
by asking how to call a python method from DTML when 'self' is one of
the arguments expected...

Here's a rough idea of my DTML method:

table
 tr
  dtml-let classcode="52.225" * just for testing the 2nd python method
directly
  dtml-var index_table_headers * python method returning first row
 /tr

dtml-in get_matrics_from *return a list of matric numbers (will be
used as an argument for next python method).
 tr
  *** what here to get result(s) from 'final' method using matric and
classcode as arguments? ***
 /tr
/dtml-in

/table

I've *called* other methods, where self has been in the parameter list
without specifying it but in these cases it was the only parameter and
there was nothing being returned. Now, most of my errors are 'not enough
arguments; expected 3'.

I'm hoping that some sleep, some coffee, a reply or a combination of the
three will give me the answer!

Thanks a lot,

Lee

Here's the Python method (pretty disgusting looking but I'll clean it
later ;-) :

Python method 'final' with parameters 'self, matric, classcode'
---
table="class" + string.replace(`classcode`, ".", "")
table=string.replace(table, "'", "")

db_conn = self.Gadfly_database_connection()
SQL = ("select practicals, assignments, tutorials, bonus from classes
where classcode = " + classcode)
result=db_conn.query(SQL)
resultString = `(result[1])`
length = len(resultString)

# To take away the last 2 brackets
i=length-1
x= ""
while (i1):
 x=x+resultString[length-1-i]
 i=i-1

# To take away the first 2 brackets
newLength=len(x)
j=newLength-1
y= ""
while (j1):
y=y+x[j]
j=j-1

# To invert the string
i=len(y)-1
z=""
while (i=0):
  z=z+y[i]
  i=i-1

components = string.split(z)

p = string.atoi(string.replace(components[0], ",", ""))
a = string.atoi(string.replace(components[1], ",", ""))
t = string.atoi(string.replace(components[2], ",", ""))
b = string.atoi(components[3])

px=p
ax=a
tx=t
bx=b

db_conn = self.Gadfly_database_connection()

SQL= "select "

i=1
while (i=p):
   SQL = SQL + "p" + `i` + ", "
   i=i+1

i=1
while (i=a):
   SQL = SQL + "a" + `i` + ", "
   i=i+1

i=1
while (i=t):
   SQL = SQL + "t" + `i` + ", "
   i=i+1

i=1
while (i=b):
   SQL = SQL + "b" + `i` + ", "
   i=i+1

SQL= SQL + " uname, fname, lname from " + table + " where matric = " +
matric

result=db_conn.query(SQL)

resultString = `(result[1])`
length = len(resultString)

# To take away the last 2 brackets
i=length-1
x= ""
while (i1):
 x=x+resultString[length-1-i]
 i=i-1

# To take away the first 2 brackets
newLength=len(x)
j=newLength-1
y= ""
while (j1):
y=y+x[j]
j=j-1

# To invert the string
i=len(y)-1
z=""
while (i=0):
  z=z+y[i]
  i=i-1

components = string.split(z)
length=len(components)
dic = {}
control=0

p = px
a = ax
t = tx
b = bx

while (p!=0):
tempDic = {('p'+`control+1`):
string.atoi(string.replace(components[control], ",", ""))}
dic.update(tempDic)
p=p-1
control=control+1

while (a!=0):
tempDic = {('a'+`control+1-px`):
string.atoi(string.replace(components[control], ",", ""))}
dic.update(tempDic)
a=a-1
control=control+1

while (t!=0):
tempString = string.replace(components[control], ",", "")
tempString1 = string.replace(tempString, '"', '')
tempString2 = string.replace(tempString1, "'", "")
tempDic = {('t'+`control+1-px-ax`): `(tempString2)`}
# tempDic = {('t'+`control+1-px-ax`): `(components[control])`}
dic.update(tempDic)
t=t-1
control=control+1

while (b!=0):
tempDic = {('b'+`control+1-px-ax-tx`):
string.atoi(string.replace(components[control], ",", ""))}
dic.update(tempDic)
b=b-1
control=control+1

lname = string.replace(components[length-1], ",", "")
fname = string.replace(components[length-2], ",", "")
uname = string.replace(components[length-3], ",", "")

lname = string.replace(lname, "'", "")
fname = string.replace(fname, "'", "")
uname = string.replace(uname, "'", "&

[Zope] Re: python method's self parameter - calling from DTML with additionalargsargs

2001-01-22 Thread Lee

Hi,

dtml-var expr="final(matric, classcode, _.this)" gives me the correct
results. Is this the correct way to do it though?

Thanks,

Lee

Lee wrote:

 Hi,

 I've got a problem snip


___
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] [python] creating variable names by adding 2 strings?

2001-01-21 Thread Lee

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] dictionaries in python *methods* :-o

2001-01-21 Thread Lee

Thanks, Steve. This'll do nicely ;-) BUT...

For some strange reason the following doesn't work in my Python *method*:

dict = {}
dict["Lee"] = 1

Error:

 Error Type: Python Method Error
 Error Value: Forbidden operation STORE_SUBSCR at line 3! -- ?

Which seems very strange. No matter what I try and store I get the same error.

dic = {'two': 2, 'three': 3}
return dic['two']

The above works fine but when I try and add to it I get the same error. If this is a
simple mistake I'm making then I plead stupidity!!! Can someone tell me how to do
this in my python method? I've tested all my code in IDLE and it works fine - why not
in Zope?

Answers on a postcard to the usual address!

Thanks very much, guys.

- Best regards,

Lee

Steve Spicklemire wrote:

 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





___
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: dictionaries in python *methods* :-o

2001-01-21 Thread Lee

Okay, I figured it out.

- Silly Lee


___
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] if-else using ZSQL resultset sendmail query

2001-01-20 Thread Lee

Hi,

I've got a few questions, which may be answered by saying, "Not
possible"! Any feedback would be appreciated.

get_testclass_details is a ZSQL method returning user data from a table.
I display the data (strangely enough) in an HTML table and I want
alternating rows to have different background colours.

I figure that the best way to do this is to obtain the resultset number
(i.e. is it the 1st, 2nd or 3rd result row) and do something like the
following;

dtml-in...
if (the result set number % 2 == 0)
 bgcolour is white
 ...
else
 bgcolour is grey
 ...
/dtml-in...

Is it possible to obtain the resultset number? 

Also, re: sendmail. I still haven't managed to figure out why it's not
posting messages to newsgroups. Maybe some folks at digicool could let
me know if this isn't supported?

Previous message was:

I have another question re: sendmail, which I'd be grateful if someone
could answer. Am I correct in saying that sendmail does not support
newsgroup postings? Adding the following to my message seems to work but

it is not being posted on the newsgroup...

To: [EMAIL PROTECTED]
Groups: uk.local.glasgow *and* Newsroups: uk.local.glasgow

It sends the mail to me; the group is listed in the header file under
'Newsgroups' when I view *my* received message but it is not getting to
the newsgroup.

Can anyone comment?

Thanks very much for your time,

- Best regards,

Lee


___
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] SQL query result set - what data structure how to access [(elements)]?

2001-01-20 Thread Lee

Hi,

I'm using a python method to query my database as follows, where I need
to use the result set to generate some HTML. I'm interested in result[0]
and result[1] as listed below;

* return result[0] gives me:
[{'name': 'PRACTICALS', 'type': 's', 'null': None, 'width': None},
{'name': 'TUTORIALS', 'type': 's', 'null': None, 'width': None},
{'name': 'ASSIGNMENTS', 'type': 's', 'null': None, 'width': None},
{'name': 'BONUS', 'type': 's', 'null': None, 'width': None}]

* return result[1] (or just 'return result') gives me:
[(1, 16, 9, 1)]

What kind of data structure is this? First impressions suggest that it's
a tuple but why the extra brackets?. I need to access each element but
how do I do this? I've tried all sort of tuple/list
conversions/operations and have had no success.

If the result is [(1, 16, 9, 1)] how can I assign...

a=1st element i.e. 1
b=2nd element i.e 16..?

I can convert it to a string, parse it and obtain the results that way,
which is simple enough, but surely there's a way to access the element
directly? Does anyone know?

Thanks,

Lee




___
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] sendmail / python list parameter - DTML method

2001-01-18 Thread Lee

Thanks again Dieter! Everything's working just about perfect but can I ask
you one quick question?

When a form is submitted the current REQUEST object's form data is cleared
and repopulated using the new form input parameters, yeah? Is it possible
to *not* clear it?

Why do I want to do this? Well, I've used dtml-call
"REQUEST.set('recipients',[])" to help me display an email message in a
form, which when submitted will be sent using sendmail.

Email message displayed here

form action="method4"
input type="hidden" name="subject" value="dtml-var subject"
input type="hidden" name="sender" value="dtml-var sender"
input type="hidden" name="senderEmail" value="dtml-var senderEmail"
input type="hidden" name="message" value=dtml-var message""
*** some code here to pass the recipient *list* as a parameter / stop the
REQUEST object from being cleared ***
*** e.g input type="hidden" name="recipients" value=dtml-var
recipients" or input type="hidden" name="recipients" value=dtml-var
recipients:list" produces the wrong results... ***
input type="submit"
/form

If the list holds ['ltyler', 'lreilly'] then displaying it in the next
method using dtml-var recipients produces ['ltyler', (i.e. the first
element). Do you know how can I get round this?

I've CC's this to the newsgroup in case someone there can help.

Thanks very much,

Lee

Dieter Maurer wrote:

 Lee writes:
   dtml-call "REQUEST.set(recipients,[])"
  dtml-call "REQUEST.set('recipients',[])"

 You have to enclose "recipients" in '...'.
 Otherwise, it is interpreted as a variable, which does not (yet) exist.

 Dieter

--
Lee Reilly
mailto:[EMAIL PROTECTED]

````

HAVE SKILLS; WILL TRAVEL.

I'm currently looking for an internship in the USA
in the field of web development. Ideally, I'm looking
for a placement for 3 to 18 months. Can you help?

More details, my resume, etc. @
http://homepages.strath.ac.uk/~aeu97172/

/shameless plug




___
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] sendmail query (confirmation)

2001-01-18 Thread Lee

Hi,

Is there anyway to confirm that a message has been sent using sendmail
other than including your own email address in the cc list?

I've got some text at the bottom of my sendmail/sendmail just saying
"Mail sent". If it reaches this then is it *guaranteed* that the message
has been sent? Is there any sort of log file kept detailing (send)mail
activity that I could perhaps use?

Thanks very much for any info.

Lee

--
Lee Reilly
mailto:[EMAIL PROTECTED]

````

HAVE SKILLS; WILL TRAVEL.

I'm currently looking for an internship in the USA
in the field of web development. Ideally, I'm looking
for a placement for 3 to 18 months. Can you help?

More details, my resume, etc. @
http://homepages.strath.ac.uk/~aeu97172/

/shameless plug



___
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] another SENDMAIL query

2001-01-18 Thread Lee

Hi there,

I have another question re: sendmail, which I'd be grateful if someone
could answer. Am I correct in saying that sendmail does not support
newsgroup postings? Adding the following to my message seems to work but
it is not being posted on the newsgroup...

To: [EMAIL PROTECTED]
Groups: uk.local.glasgow *and* Newsroups: uk.local.glasgow

It sends the mail to me; the group is listed in the header file under
'Newsgroups' when I view *my* received message but it is not getting to
the newsgroup.

Can anyone comment?

Thanks a lot :)

- Best regards,

Lee

--
Lee Reilly
mailto:[EMAIL PROTECTED]

````

HAVE SKILLS; WILL TRAVEL.

I'm currently looking for an internship in the USA
in the field of web development. Ideally, I'm looking
for a placement for 3 to 18 months. Can you help?

More details, my resume, etc. @
http://homepages.strath.ac.uk/~aeu97172/

/shameless plug



___
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] sendmail implementation problem

2001-01-16 Thread Lee

Hi Dieter,

Thanks again for your help :)

I'm having some trouble creating the new variable in REQUEST - maybe you
know why?

The REQUEST object holds:

KEY ITEM
lreilly lreilly (recipient - '@cs.strath.ac.uk' is appended)
ltlyer  ltyler (recipient - '@cs.strath.ac.uk' is appended)
subject subject
sender  sender
message message
senderEmail senderEmail

But when I add in the code to create 'recipients' in the REQUEST object
and then try and view REQUEST's contents again I get an error:

 Error Type: NameError
 Error Value: recipients

Here's the method:

``,,
dtml-var standard_html_header

dtml-call "REQUEST.set(recipients,[])"
dtml-in "REQUEST.form.items()"
dtml-if expr="_['sequence-key'] in
('message','sender','senderEmail','subject')"
input type="hidden" name="dtml-var name="sequence-key""
value="dtml-var name="sequence-item""
dtml-else
dtml-call "recipients.append(_['sequence-key'])"
/dtml-if
/dtml-in

dtml-in expr="REQUEST.form.items()" 
dtml-var name="sequence-key": dtml-var name="sequence-item"br
/dtml-in

dtml-var standard_html_footer
``,,

Can you see any obvious problems? Thanks very much for your time.

- Best regards,

Lee

--
Lee Reilly
mailto:[EMAIL PROTECTED]

````

HAVE SKILLS; WILL TRAVEL.

I'm currently looking for an internship in the USA
in the field of web development. Ideally, I'm looking
for a placement for 3 to 18 months. Can you help?

More details, my resume, etc. @
http://homepages.strath.ac.uk/~aeu97172/

/shameless plug


___
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] REQUEST object - obtaining variables from

2001-01-15 Thread Lee

Hi there,

Thanks for your help. I'm currently using the following code, which works perfectly;

dtml-in expr="REQUEST.form.items()"
  dtml-let text="_['sequence-key'] + 'x' + _['sequence-item']"
  dtml-call expr="updateDB(text)"
  /dtml-let
/dtml-in

Randy's response provided the following code, which didn't work nor did any variation
on it. Surprising as it 'appears' to be doing almost the same thing as above(?).

dtml-in expr="REQUEST.form.items()"
dtml-in expr="updateDB(text=_['sequence-key'] + 'x' + _['sequence-item'])"
   dtml-var result
/dtml-in
/dtml-in

Cheers,

Lee

[EMAIL PROTECTED] wrote:

 On Sat, Jan 13, 2001 at 06:11:08PM +, Lee wrote:
 You have indeed overlooked something.  There are tons of things in REQUEST
 unrelated to your form.

 To simply display the entire request, put
 tml-var REQUEST
 in display/index_html

 To access the value of name1 in display/index_html,
 you can use many forms:

 dtml-var REQUEST['name1']

 dtml-var name1#may get something else if name1 is NOT in REQUEST

 dtml-with REQUEST
   dtml-var name1
 /dtml-with

 dtml-in ('name1', 'age1', 'name2', 'age2')
   dtml-var "REQUEST[_.['sequence-item']]"
 /dtml-in

--
Lee Reilly
mailto:[EMAIL PROTECTED]

````

HAVE SKILLS; WILL TRAVEL.

I'm currently looking for an internship in the USA
in the field of web development. Ideally, I'm looking
for a placement for 3 to 18 months. Can you help?

More details, my resume, etc. @
http://homepages.strath.ac.uk/~aeu97172/

/shameless plug




___
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] sendmail implementation problem

2001-01-15 Thread Lee

Hi,

This is more of an implementation problem that anything else, which is
probably starightforward enough for those with more experience that
myself. The simplified version is as follows:

Form A collects usernames and send these to Form B.

Form B takes the input parameters from the REQUEST object and places
them in 'hidden' form inputs with name="username" and provides some
input textfields prompting for 'subject', 'message', etc. These are
submitted to Form C

Form C displays all the parameters in the REQUEST object and gives a
view of what the email will look like, e.g.

+---=
| To: [EMAIL PROTECTED]   |
| From: [EMAIL PROTECTED], [EMAIL PROTECTED]   |
| Subject: Zope |   
|   |
| My message here   |
|   |   
+---=

Everything (bar the recipients) can be specifided using dtml-var
subject, etc. as required but as the usernames in the hidden field are
passed into a method, which does not know their names; I have to get
them from the REQUEST object again. I have produced the following code
to collect all the usernames (used to creat recipients email address);

dtml-in expr="REQUEST.form.items()" 
dtml-if expr="(_['sequence-key'] == 'message') or (_['sequence-key'] ==
'message') or (_['sequence-key'] == 'sender') or (_['sequence-key'] ==
'senderEmail') or (_['sequence-key'] == 'subject')"
dtml-elsedtml-var name="sequence-key": dtml-var
name="sequence-item"
/dtml-if
/dtml-in

So displaying the email is easy but how can I send this to my sendmail
method?

1 - Simply collect all the usernames, variables in hidden fields and
send them onto sendmail?
2 - or is there a way to CALL my sendmail method for each individual
recipient (email address) from this method simply by hitting a SUBMIT
button?

Which is the easiest/most efficient way to go about this? Ideally, I
want the email dislayed (like it's formatted above) and then just simply
hit a submit button to send it to multiple recipients. I'd rather not
have something like 'lee.reilly@ntlworld, [EMAIL PROTECTED]' in the 'To:'
field - just multiple, individual emails.

It's late - but I hope that makes sense(?). Thanks very much for any
guidance you can give me!

- Best regards,

Lee

--
Lee Reilly
mailto:[EMAIL PROTECTED]

````

HAVE SKILLS; WILL TRAVEL.

I'm currently looking for an internship in the USA
in the field of web development. Ideally, I'm looking
for a placement for 3 to 18 months. Can you help?

More details, my resume, etc. @
http://homepages.strath.ac.uk/~aeu97172/

/shameless plug


___
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] renaming python input params in DTML

2001-01-14 Thread Lee

Hi,

I am having a problem passing in a variable to a Python method, which is
obtained from the REQUEST object - I'd really appreciate someone's
insight into how to correctly go about this.

I have a form that submits a parameter named '9728430xp0xclasstest' with
a value = 7 to a DTML method.

I have a Python method expecting 'text' as a parameter so I want the
DTML method to send 'text' onto this with a value = the value of the
original parameter appended to name (i.e. 9728430xp0xclasstestx7).

So text=9728430xp0xclasstestx7

Does that make sense?

The Python method, testSQL, returns 'result'. As I recently found out, I
have to make to make use of the REQUEST object to obtain these
parameters.

The following snippet produces the correct value
(9728430xp0xclasstestx7)...

dtml-in expr="REQUEST.form.items()"dtml-var sequence-keyxdtml-var
sequence-item/dtml-in

... but how can I can pass this as 'text' to my Python method?

Am I on the right track with the following:

dtml-in expr="REQUEST.form.items()"
dtml-in expr="testSQL(text='dtml-var sequence-keyxdtml-var
sequence-item')"
dtml-var result
/dtml-in/dtml-in

Thank very much for any help you can offer.

- Best regards,

PS:

dtml-let text="'9728430xp0xclasstestx7'"
dtml-var text
/dtml-let ... may help

but...

dtml-var standard_html_header
dtml-in expr="REQUEST.form.items()"
   dtml-let text="'dtml-var sequence-keyxdtml-var sequence-item'"
  dtml-var text
 /dtml-let
/dtml-in ... gives me text = x !

Any help would really be appreciated?

Thanks :)

--
Lee Reilly
mailto:[EMAIL PROTECTED]

````

HAVE SKILLS; WILL TRAVEL.

I'm currently looking for an internship in the USA
in the field of web development. Ideally, I'm looking
for a placement for 3 to 18 months. Can you help?

More details, my resume, etc. @
http://homepages.strath.ac.uk/~aeu97172/

/shameless plug




___
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] REQUEST object - obtaining variables from

2001-01-13 Thread Lee

Hi,

I am having some problems with the REQUEST namespace/object. I
understand that if I submit form data then it can be retrieved using the
REQUEST object. I have looked at Chapter 7 (Advanced DTML) for support
but I'm still no closer to success.

I have a DTML method, which passes an unknown number of arguments with
unknown names to another method. For example,

form action="display"
Name input type="text" name="name1"br
Age input type="text" name="age1"br
Name input type="text" name="name2"br
Age input type="text" name="age2"br
input type="submit"
/form

I would like the display method to simply show each of the variable's
names and values i.e. iterate through each variable in the REQUEST
object. Maybe I've overlooked something in the Zope documentation but
could someone supply a useful snippet of code to get me started?

Thanks very much,

Lee

--
Lee Reilly
mailto:[EMAIL PROTECTED]

````

HAVE SKILLS; WILL TRAVEL.

I'm currently looking for an internship in the USA
in the field of web development. Ideally, I'm looking
for a placement for 3 to 18 months. Can you help?

More details, my resume, etc. @
http://homepages.strath.ac.uk/~aeu97172/

/shameless plug




___
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] importing string module in python METHOD - a problem that shouldn't be aproblemproblem

2001-01-13 Thread Lee

Hi,

I have a Python method that needs to use the string module. In the
method body I have the 'import string' statement but when I try it =

Error Type: ImportError
Error Value: __import__ not found

The documentation collaborates that import statements (the string module
specifically) can be used in Python methods. The method body is...

import string
text = details
y = string.split(text,"x")
studentMatric = y[0]
studentRecord = y[1]
return studentMatric + studentRecord

.., which results in the above error. Can anyone suggest a reason for
this? I think (hope) it'll work if I put it in my extensions directory.

Thanks very much,

Lee

--
Lee Reilly
mailto:[EMAIL PROTECTED]

````

HAVE SKILLS; WILL TRAVEL.

I'm currently looking for an internship in the USA
in the field of web development. Ideally, I'm looking
for a placement for 3 to 18 months. Can you help?

More details, my resume, etc. @
http://homepages.strath.ac.uk/~aeu97172/

/shameless plug


___
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] multiple unknown parameters - ZSQL

2001-01-09 Thread Lee

Hi,

As usual, I'm finding this one hard to explain... so I've described it
with the aid of a diagram @
http://homepages.strath.ac.uk/~aeu97172/h.htm

I realise that this may be more of a burden on your time than a normal
request... but I'm hoping that some of you have met similar problems
before and can suggest the best way round the problem.

Any comments would be greatly appreciated.

Thanks very much,

Lee

--
Lee Reilly
mailto:[EMAIL PROTECTED]

````

HAVE SKILLS; WILL TRAVEL.

I'm currently looking for an internship in the USA
in the field of web development. Ideally, I'm looking
for a placement for 3 to 18 months. Can you help?

More details, my resume, etc. @
http://homepages.strath.ac.uk/~aeu97172/

/shameless plug

___
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] [python] converting int to string?

2001-01-07 Thread Lee

Hi,

I wonder if anyone could help me here...

Is there any way to convert an integer to a string data type in Python?
I see there is a facility for accomplishing the reverse conversion
(string - int)?

I have 4 integers, which are primarily used to handled the logic in the
program below (in the while loops). The value of this integer must also
be added to a string (as a table column name), which will be used to
create a SQL query.

Here's a rough sketch of the program:

p = 2 # no.of practicals
t = 2 # no.of tutorials
a = 2 # no.of assignments
b = 3 # no.of bomus marks

c = "52225"

SQL = "CREATE TABLE CLASS" + c + "\n"
SQL = SQL + "( \n"
SQL = SQL + "matric float, \n"
SQL = SQL + "fname varchar, \n"
SQL = SQL + "lname varchar, \n"
SQL = SQL + "uname varchar, \n"

while p  0 :
 SQL = SQL + "p" + p + " integer, \n" # cannot add type "int" to
string
 p = p - 1

while t  0 :
 SQL = SQL + "t" + t + " char(1), \n"
 t = t - 1

while a  0 :
 SQL = SQL + "a" + a + " integer, \n"
 a = a - 1

while b  1 :
 SQL = SQL + "b" + b + " integer, \n"
 b = b - 1
while b  0 :
  SQL = SQL + "b" + b + " integer \n" # ',' taken out from last
query
  b = b - 1

SQL = SQL + ")"

Of course, I could have a load of statements in the while loops like:

if p = 1:
pString="1"
... etc.

But that would look hella ugly!

Another alternative would be to send both the integer value and a string
parameter (converted by Zope) in the calling DTML method. This is okay -
but is there a better way to do it?

As usual, thankyou very much in advance.

Is this off-topic BTW? Should I address any future questions regarding
Python to a Python newsgroup/list?

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




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

2001-01-06 Thread Lee

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

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

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

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

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

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

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

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

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

string classAndCode = CLASSCODE;

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

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

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

... etc

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

Thanks very much in advance.

Lee

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

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




___
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] dtml

2001-01-06 Thread Lee Hunter

You should read the Zope Book at

http://www.zope.org/Members/michel/ZB

Especially the chapter on DTML

http://www.zope.org/Members/michel/ZB/DTML.html


If you want to see DTML source code in action there is a link at the bottom
of many of the pages on the http://www.zope.org site that exposes the code.

The tutorial that comes with Zope is also helpful.

Good luck
Lee Hunter

Nando n wrote:

 i want to know as much as possible about dtml.
 what is its purpose??? i really wanna know that answer. cause i
 have to do
 dtml like preprocessor for ASP in visual basic.
 could you give me as many urls of dtml sites and real dtml site examples?
 _


 ~~~

  H U M  C O M M U N I C A T I O N S  L T D

  * content management  * technical editing
  * web design  Flash development

   Ste. 147 99 Fifth Avenue
   Ottawa ON Canada K1S 5P5

  1-819-459-2511


___
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] SELECT COUNT(*) ZSQL method - displaying results?

2001-01-05 Thread Lee

Hi,

I am having difficulty displaying the results from an SQL query:

SELECT COUNT(*)
FROM REGISTRY
WHERE dtml-sqltest classcode op=eq type="float"

When I call the ZSQL method from my DTML method and try and display the
result (using dtml-var count) I get a rather horid, "This resource may
be trying to reference a nonexistent object or variable count" error.

My only thought is that because 'count' isn't actually a proper variable
(i.e. a column name) it is handled differently.

Can anyone see my error / offer advice?

Thanks very much in advance.

- Best regards,
Lee

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




___
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] What's 'section' in blocks[0] in block dtml tag?

2001-01-01 Thread LEE Kwan Soo

Hi. I'm playing/struggling to make a custom block dtml tag.
Let me call it, dtml-quote tag.
dtml-quote tag is similar to dtml-comment tag except it will emit
html_quoted, not rendered version of what lies 
between dtml-quote ... /dtml-quote.
(I feel it will be usefull when I show  write some dtml examples on my
korean zope site).

After seeing around some python sources,
I finally got that tname is the name of the tag, args is args, and section
is something, in the following code.

def __init__(self, blocks):
tname, args, section = blocks[0]

and section seems to have 6 attributes/methods:
'__name__', '_v_blocks', '_v_cooked', '_vars', 'blocks', 'globals', 'raw'

But that mistic raw is null string, '' and blocks is no help for me.

How can I retrieve the raw source string enclosed in a block tag pair?

LEE Kwan Soo.

ps. My English is evem more cryptic this morning. Sorry I've sat up alnight play 
Kingdom Under Fire.

___
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] A Picture of Zope, The Fish

2000-12-26 Thread LEE, Kwan Soo

* I only subscribes to zope-dev. but the recent messages of zope list seems makes me 
to write to zope list*

Here is a picture of Zope, the fish and some facts:
http://www.fishbase.org/Summary/SpeciesSummary.cfm?genusname=Abramisspeciesname=ballerus

Its zoological name is Abramis ballerus and named by Linnaeus himself.

Any volunteer to make a nice emblem for zope from this picture?

LEE Kwan Soo.
http://phps.snu.ac.kr:8080/ZOPE
http://users.python.or.kr/PyKUG/

___
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] Creating tables from ZSQL methods..?

2000-12-17 Thread Lee

I have a ZSQL method, createClassTable, where the paramter 'classCode'
is used to name the table:

create table dtml-sqlvar classCode type=string
(
matric float,
fname varchar,
lname varchar,
.. etc
)

Is there anyway to execute this in a DTML document 'on the fly'?

I have a DTML method where the classCode argument is passed onto the
ZSQL method via a web form... but when submitted I am met with Zope
interface and asked to enter the query parameter.

What I am trying to do: The user will click 'Submit' - and a table is
created... the NEXT generated screen will be a view of the database,
where he can edit content via web forms, etc. How do I execute the query
and go to this view screen in one go?

Creating a ZSearchInterface on my ZSQL method has given me a few
ideas... but all of them have their problems. Can anyone offer any
solutions?

Thanks,

Lee

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



___
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] sql query results - DTML method problem

2000-12-16 Thread Lee Reilly CS1997

Hi,

I have a TINY problem, which I think there is a simple solution too...
but for the life of me, I can't find it! I'd be grateful if someone
could point me in the right direction.

I have a database setup containing details of classes, students 
lecturers. The user is prompted to enter a class code (a unique key)
which is used to query the database and return the class title. Simple.

A DTML method prompts me for the class code
-- I enter 52.139 and it posts to a method 'enterClassCodeAction',
below.

#1  dtml-var standard_html_header
#2  h2Confirm/h2
#3  pYou entered idtml-var class_code/i/p
#4
#5  p
#6  Our records show that dtml-var class_code is called
#7
#8  dtml-in expr="findClassTitle(code=52.139)"
#9  dtml-var title
#10 /dtml-in
#11 
#12
#13 /p
#14 dtml-var standard_html_footer

^ The method works fine when the class code is manually inserted (line
#8) but when I try to pass the variable from the previou post, held in
dtml-var class_code I have probs.

dtml-in expr="findClassTitle(code=dtml-var class_code)" *** syntax
error

findClassTitle is a ZSQL method for returning the class title given a
class code:

select title from classes 
where dtml-sqltest code op=eq type=float

Hmm... anyone see the problem?

Thanks a lot :)

- Best regards,

Lee

___
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: sql query results...

2000-12-16 Thread Lee Reilly CS1997

It's okay folks - I figured it out. 

I believe that it was Homer Simpson who once said, "Doh!".

Cheers,

Lee

___
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] footer

2000-12-16 Thread Lee Reilly CS1997

  /td/tr/table/center
  /font/td
  /tr
  tr 
td width="9%" bgcolor="#3D4E93" height="9"nbsp;/td
td bgcolor="#3D4E93" colspan="2" height="9"
  div align="right"font face="Verdana, Arial, Helvetica,
sans-serif" size="2" color="#FF"Written 
by Lee Reilly/font/div
/td
  /tr
/table
/body
/html

___
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] mySQL DA on Win32

2000-12-14 Thread Lee Reilly CS1997

Hi,

Zope is currently being installed on the Unix machines at my uni but it
won't be available for a while. However, I have set up a mySQL database
in the Dept. and installed Zope on a Dept. machine (Windows 95). I can
only access the database from uni so I must have a database adpater
setup on this machine.

I have seen the mySQL DA on Zope.org but I understand that it "does not
support win32 platforms at this time". I need database access ASAP so
can anyone offer any advice?

Thanks very much,

Lee

___
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] HTML formatting from a text field

2000-12-13 Thread Lee Hunter

Hi Ausum,

Do you mean a text field that shows a row of formatting buttons at the top
for 'bold', 'italic' 'add link' etc.

There is an ActiveX control that is built in to IE Explorer 5.x - you just
have to call it from your page.

Here's the information from Microsoft:

http://msdn.microsoft.com/workshop/author/dhtml/edit/ref/cncpt.asp

If you get it working with Zope (which shouldn't be a problem) let us know.

The Manila/Frontier CMS uses it as a default and it works well. It's very
handy when you have users who have basic word processor knowledge (i.e. they
know enough to select text first then click a formatting button) but can't
be trusted with hand coding html.

Cheers

Lee Hunter



  - - - H U M  C O M M U N I C A T I O N S  L T D - - -
website design, content management and technical editing
   Ste. 147 99 Fifth Ave Ottawa ON Canada K1S 5P5
  1-819-459-2511


Ausum wrote:
 what I have in mind, wich is
 a sort of simple html editor within a text field. As I said before, the
 only place I've seen something like that is at Hotmail.



___
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] quick python book - question about the feedback form example

2000-12-09 Thread Lee

Hi,

Finally got my hands on The Quick Python book and have read the first 13
chapters. I've now jumped to chapter 26, "Using Zope", to try out some
of the examples there. I'm havng a problem with the feedback form
example (p326) and I'd be really grateful if someone could point out
what I am doing wrong.

- I created a directory in the root called 'feedback' and to this I
added a DTML document, 'index_html'. I see no probs with this but maybe
someone could confirm that the post action is correct for me.

index_html
-
dtml-var standard_html_header
FORM ACTION="/cgi-bin/feedback/save_feedback" METHOD="POST"
Type of feedback:
SELECT NAME="feedback_type"
OPTIONCompliment
OPTIONCriticism
/SELECT
p
Your comments:
TEXTAREA NAME="comments"/TEXTAREA
INPUT TYPE="SUBMIT" VALUE="Submit Feedback"
/FORM
dtml-var standard_html_footer

- I then create a python method called 'feedback.py' containing the
following:

feedback.py
--
"""feedback.py: A simple feedback form application"""
def save_feedback(feedback_type, comments):
""" A function to handle submitted feedback form data"""
# Open a file for appending to save the feedback
# creating the file if necessary
try: file=open("feedback_data", "a")
except IOError:
file=open("feedback_data", "w")
# Save the data
file.write("Feedback type: %s\n" % feedback_type)
file.write("Comments: %s\n\n % comments)
file.close()
return "Thankyou for your feedback!"

^ On the Python method addition screen I use feedback(.py) as the ID +
title and insert "feedback_type, comments" in the parameter list. Of
course, this results in an error SyntaxError  Invalid token.

I tried to modify it by taking out the first 2 lines of the above code,
renaming the method 'save_feedback' but still no success. I'm unsure
whether the return statement will do anything in Zope also.

Can anyone help?

- Best regards,

Lee (with 10 crossed fingers  toes)

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




___
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] Another Zope E-Commerce Site Online

2000-12-06 Thread Lee Hunter

Site looks beautiful but I would *never* have guessed that it was an ecom
site unless you told me.

Even then it was just by accident that I clicked an image and came to a
price and description. Maybe that's the part you were refering to as being
in progress.

Otherwise the site works great.

Cheers

Lee Hunter
Hum Communications Ltd.



 Brad Clements wrote:

  Just announcing this new e-commerce zope based site.
 
  http://www.adirondackcraft.com
 
  Come buy something, but don't whack it too hard, this site is still a
  work in progress (aren't they all?)



___
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] Sort broken on zope.org site...

2000-12-05 Thread Darin Lee

Zopistas,

Following up on my question yesterday, regarding sorting on the results columns of 
keyword/text based searches, I have noticed that if I do a text search on the zope.org 
site and then try to sort on a column - the same error comes up:

Error type:  TypeError
Error value: loop over non-sequence

I looked through the collector - but couldn't find anything related to this issue. 
Does anyone have any insight on how to fix this?

Thanks,
-Darin Lee


___
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] [ot] python book

2000-12-05 Thread Lee Reilly CS1997

Hi,

I'm going through the tutorials available on Python.org but can anyone
recommend a good book?

I've always been impressed by O'Reilly's books and I see that there are
a number of them available:

- Python Programming on Win32 
- Learning Python 
- Programming Python 

Which one of the above (or indeed, any others) would be best for me? 
Me? I've got some C experience and will be using Python with Zope to
create a portal,  some simple apps.

Any advice would be greatly appreciated.

- Best regards,
Lee

___
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] Passing lists in a get request (ZCatalog Search) Continued...

2000-12-04 Thread Darin Lee

Zopistas, 

Everyone, Thanks for the help so far. My searchable form and indexes are working 
great, except for one small problem. Whenever I pass in a string to search on a 
text-index, along with the sort_on and/or sort_order parameters I keep getting the 
following error:

Error Type: TypeError
Error Value: loop over non-sequence

Traceback (innermost last):
  File C:\PROGRA~1\DEQ_UP~1\lib\python\ZPublisher\Publish.py, line 222, in 
publish_module
  File C:\PROGRA~1\DEQ_UP~1\lib\python\ZPublisher\Publish.py, line 187, in publish
  File C:\PROGRA~1\DEQ_UP~1\lib\python\Zope\__init__.py, line 221, in 
zpublisher_exception_hook
(Object: Traversable)
  File C:\PROGRA~1\DEQ_UP~1\lib\python\ZPublisher\Publish.py, line 171, in publish
  File C:\PROGRA~1\DEQ_UP~1\lib\python\ZPublisher\mapply.py, line 160, in mapply
(Object: search)
  File C:\PROGRA~1\DEQ_UP~1\lib\python\ZPublisher\Publish.py, line 112, in call_object
(Object: search)
  File C:\PROGRA~1\DEQ_UP~1\lib\python\OFS\DTMLMethod.py, line 172, in __call__
(Object: search)
  File C:\PROGRA~1\DEQ_UP~1\lib\python\DocumentTemplate\DT_String.py, line 528, in 
__call__
(Object: search)
  File C:\PROGRA~1\DEQ_UP~1\lib\python\DocumentTemplate\DT_In.py, line 473, in renderwb
(Object: Catalog)
  File C:\PROGRA~1\DEQ_UP~1\lib\python\Products\ZCatalog\ZCatalog.py, line 455, in 
searchResults
(Object: Traversable)
  File C:\PROGRA~1\DEQ_UP~1\lib\python\Products\ZCatalog\Catalog.py, line 602, in 
searchResults
  File C:\PROGRA~1\DEQ_UP~1\lib\python\Products\ZCatalog\Catalog.py, line 555, in 
_indexedSearch
TypeError: (see above)

So, on a hunch - I tried the query directly on the Catalog method itself (not my 
home-brew code). 
I typed in 
"http://myserver/Catalog/report?main_references=Airsort_on=categorysort_order=reverse"


Same problem - I f I try to query against a zCatalog text-index, and also pass the 
sort_on or sort_order parameters - I get the error.

Is this a Zope bug?

I'd appreciate any information anyone can pass on - I'm so close to getting this thing 
working...

Thanks in advance,
-Darin Lee



___
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] BSD 4 installation

2000-11-24 Thread Lee Hunter

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.



___
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] python methods

2000-11-23 Thread Lee Reilly CS1997

Hi,

I'm having problems with Python methods. I've followed the  instructions
for the guestbook example [1] to the letter but when I add the Python
method [2] is causes an error as follows:

Error Type: NameError
Error Value: context

TraceBack: Traceback (innermost last): File
/usr/local/Zope-2.1.6-src/lib/python/ZPublisher/Publish.py, line 165, in
publish File
/usr/local/Zope-2.1.6-src/lib/python/ZPublisher/mapply.py, line 160, in
mapply (Object: addEntryAction) File... etc. 

Can anyone offer any advice?

- Best regards,
Lee Reilly

[1] http://www.zope.org/Members/michel/ZB/SimpleExamples.html

[2] Python method
  """
  Create a guest book entry.
  """
  # create a unique document id
  id='entry_%d' % len(context.objectIds())

  # create the document
  context.manage_addProduct['OFSP'].manage_addDTMLDocument(id,
   title="", file=comments)

  # add a guest_name string property
  doc=getattr(context, id)
  doc.manage_addProperty('guest_name', guest_name, 'string')

___
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] Search and replace

2000-11-21 Thread Lee Hunter

Kapil wrote:

 that would like to see this changed.  Building such an interface with
 gnome or kde would be possible, indeed there are already efforts
 underway to do both. But to create a cross-platform solution really
 needs... Mozilla. Sadly, the ZopeMoz projects appears to be dead,
 hopefully developer interest can be generated in reviving it after
 ActiveState releases the python bindings to XPCOM (which should be
 soon).

Wasn't there some talk of using Radio Userland (formerly Pike) as an
interface to Zope? It's too bad that Userland has made the very odd decision
to broaden RU into a music sharing gizmo - it really lost focus after that
point. But at least it still offers my beloved search and replace and a few
other basic editing tools.

On the other hand I actually *like* the Zope management interface - in fact,
so far I've found it to be very easy to understand and a total pleasure to
use. It just doesn't offer some things that I must have - features that
would probably be hard to incorporate into a browser interface.

Regards

Lee Hunter
Hum Communications Ltd.



___
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] Search and replace

2000-11-20 Thread Lee Hunter

Martin Winkler wrote:
  the object-oriented approach is great for not having
 to search/replace
 anymore. I really do not know any situation where s/r is
 still needed. The
 people who fill in content in our company have
 ZClass-Interfaces, and they
 only insert actual content.

I understand the beauty of object oriented programming and that it also has
some application for content and user interface elements.

But what happens when the random, free form content that your users are
inserting contains errors or has to be globally changed?

Maybe the manufacturers of Spam send your company a lawyer's letter saying
that use of the word 'Spam' on your website infringes on their trademark and
your boss tells you to change every instance of 'Spam' to 'processed meat
product' including all of your heavily trafficked Squishdot discussions, but
not where Spam was used to refer to the Monty Python skit.

What would you do in that situation? Would you have made the word 'Spam' a
variable simply because it was used in more than one location?

Regards

Lee Hunter
Hum Communications Ltd.



___
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] Search and replace

2000-11-20 Thread Lee Hunter


Martin Winkler wrote
 I just wanted to express that this feature may be too hard to
 program for
 the (IMHO) rare cases that we really need it, but IF there

I had understood that Python and Zope excelled at string manipulation.
That's why I am surprised that it would be difficult to scan a folder full
of documents to find a word and replace it with another (with the option of
ignoring anything in pointed brackets). I'm not a programmer so I probably
don't appreciate the complexities of the task, however in this case it seems
like the object-oriented database is a hindrance rather than a help. If it
was just a batch of html files I could search and replace through them with
just about any piece of software on my desktop.

I wouldn't know whether this is the sort of tool that is generally useful,
but in my work I use search and replace all the time (if only to fix my
endless confusion over 'its' and 'it's')

Cheers

Lee Hunter
Hum Communications Ltd.


___
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] Search and replace

2000-11-19 Thread Lee Hunter

Is there any way to do a 'search and replace' in a Zope folder (and it's
subfolders)?

TIA

Lee
Hum Communications Ltd.


___
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] Search and replace

2000-11-19 Thread Lee Hunter

Ouch!

Zope has no built in way to do search and replace? As an editor, that is a
*very* serious drawback indeed!

The first workaround you suggest may be useful when  creating new pages
although  only when you can guess what might change in the future and it
also requires that all of the people creating content think like
programmers, not writers.

The second approach seems somewhat risky, complex and challenging for an
unsophisticated user.

Isn't replacing text one of the most fundamental tasks when creating and
maintaining a web site or any other set of documents, for that matter?

Shouldn't there be a S  R tab on every folder object that provides a choice
of replacing html, dtml or text and that spits out a report on what was
changed? Or even better, that first gives you a report of *proposed* changes
and then allows you to check off the ones you want to ok.

Lee Hunter
Hum Communications Ltd.

 -Original Message-
I wrote:
 Is there any way to do a 'search and replace' in a Zope
 folder (and it's
 subfolders)?

Martin Winkler replied
 AFAIK: no. But on the other hand: why do you need it? That's
 what objects
 are for... Just create a method with the text that may change
 sometimes and
 is displayed on many pages, and include it with dtml-var ...
 One possibility I see is: export the folder as XML, edit the
 file in your
 favourite text-editor and do a search 'n replace. (with the
 dtml-var, of
 course ;-)
 Then import the file again.

 Hope this helps,

 Martin



 ___
 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] chapter 5 Zope book - problems with the examples

2000-11-16 Thread Lee Reilly CS1997

Hi,

I'm going through the examples in Chapter 5 of the Zope book and am
having some problems. For those of you familiar with it, it is the 'Zope
Zoo' example.

Can anyone help me out?

1 - I create a DTML method called navigation as follows:

ul
dtml-in expr="objectValues('Folder')"
  lia href="dtml-absolute_url;"dtml-var title_or_id/abr/li
/dtml-in
/ul

2 - On viewing this method it works fine - a hyperlink to all
sub-folders appears in the browser.

3 - I add 'dtml-var navigation' into my standard_html_header so it
reads:

html
head
titleZAPHOD - zopetastic!/title
font face="Verdana, Arial, Helvetica, sans-serif" size="2"
/head
body bgcolor="#FF" LINK="#99" VLINK="#55"
pfont face="Verdana, Arial, Helvetica, sans-serif" size="1"
If your name is Lee then click a href="manage"here/a to
login./font 
br
dtml-var navigation

4 - On viewing index.html (containing header  footer) everything except
the navigation method appears. Viewing the source of index.html reveals
that the ul tags are created... just no li elements.

5 - The HTML is fine... all tags closed  in te right place.

Can anyone see a problem?

Thanks in advance for any replies. My appologies also for such a long
post.

- Best regards,
Lee Reilly

___
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] Newbie Install: Solaris/Zeus

2000-11-15 Thread Lee Hunter

I'm trying to install Zope 2.2.2 on a shared web host that uses Zeus running
on Solaris.

When I try to run "python w_pcgi.py" I get the following error:



Zope requires Python thread support!



The version of Python on the machine is 1.5.2

Any thoughts on what I'm doing wrong?

Cheers

Lee


___
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] university portal

2000-11-05 Thread Lee

Hi,

I'm another Zope newbie with a few questions. My appologies if this message is being 
sent to the wrong mailing list.

I'm a final year student doing a project to create a course/personal management system 
for my university. I
understand there's quite a lot of similar work going on in this field already.

I aim to create a database to store student information in (using mySQL or Zope?) 
which the user (the lecturer) can
add content to (details of grades, etc) via a web browser and use for bulk 
manipulation of data... sending email
amongst other things. In addition, I hope to provide a 'wizard' (in a browser window) 
to provide facilities for
uploading lecture material, news, etc. to the course web page. Going through Zope's 
'Elvis' tutorial this seems
possible.

[Q] Is it possible to present a user with various web forms to input information (say, 
a news article with headline
 content) that once submitted will be displayed on the page in a suitable format? I 
think Zope is capable of
this... is Python/anything required. Are there any examples I can look at?

I am in the process of reading the online Zope book - if anyone has any advice for 
reading material, I would be
grateful to hear it :-)

[Q] There are a lot of Zope products available - am I right in thinking that, say a 
'Zope Discussion Board' product,
could be download and integrated into a Zope-powered web-site? i.e. Are Zope products 
'plug and play' TM? ;-o

Thanks for the bandwidth,

Lee




___
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] How do I logout?

2000-11-04 Thread Lee Curtis

Hi all,

How do I logout or switch users when running Zope?

I've got some DTML code that does it - sometimes, othertimes it produces a
keyerror.

This must be a common problem - coz I'm logged in as super user and want to
switch back to my regular username.

Contributions of help greatly appreciated...

Thanks.

lee


___
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] Obtaining just the filename for multiple file fields in an addformform

2000-11-03 Thread Darin Lee

Zopistas,

I have a form that has multiple file upload fields in it (5 to be exact). I am 
handling the upload via DTML. Essentially this is a "publication" item that can have 
multiple formats of a file attached (PDF,  Powerpoint, Word, Excel, HTML). I would 
like the user to create the publication item (Zclass object), and then attach whatever 
format files they require to the add form.

The Publication object is folderish and contains which of the files they uploaded. The 
problem comes in with naming the files. I can't figure a way to get the file name from 
the upload field without getting the entire local path on the user's machine.


The following code works, if I manually delete the path out of the field in the 
browser (ie5) and just leave the filename:
dtml-call "manage_addFile(_.getattr(file1, 'filename'), REQUEST['file1'])"  

However, I would rather get the filename, split it on the \'s, and then take a slice 
to get at the actual filename [:1] to pass to manage_addFile. The problem is, I'm not 
sure how to get this to work in DTML.

This is also clumsy, because in this case there are 5 file upload fields on the form - 
the way I am approaching it would require the same code to be repeated 5 different 
times. Is there an array/list of the file fields I could loop through?

Thanks in advance,
-Darin Lee


___
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] Making Product Base Classable

2000-11-03 Thread Darin Lee

Zopistas,

I would like to make a Zclass a baseclass of the Btree folder object. I installed 
Btree but it's not appearing in the list of base classes. Is there a way to get it in 
there? Any help would be greatly appreciated.

Thanks in advance,
-Darin Lee


___
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] Installation on Linux

2000-11-01 Thread Lee Curtis

Hi All,

I feel like a bit of an idiot, but I can't find any info about installing
Zope until Unix - only Windows.

Can anyone give me a quick start guide ??




Much Appreciated



Lee Curtis


___
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] Multi-lingual sites and workflow

2000-11-01 Thread Lee Hunter

I was wondering if anyone here has used Zope to create
bilingual/multi-lingual/localised websites.

I've done a number of bilingual (French and English) projects in recent
years using plain old html where the two language versions had to be kept
mostly symmetrical and its been a bit of a pain as the site grows to keep
the two versions in synch and make sure the translations are done on time
etc.

Its seems that Zope might help manage these kinds of projects - by smoothing
the workflow - tracking what needs translation, perhaps sending stuff to the
translator automatically, reporting on what's been done by who and comparing
the two language versions to make sure they are parallel. And perhaps even
sharing a common architecture - so that you didn't need two sets of DTML
methods etc.

I'm wondering if this fits into other generic Zope workflow products that
people have talked about developing or if it would have to be built from
scratch.

Anyone have thoughts on this subject?

Regards

Lee Hunter
Hum Communications Ltd.



___
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] Webdav Questions

2000-10-27 Thread Darin Lee

Zopistas,

I am working under Windows NT 4 and connecting to my Zope Server via the webfolders 
icon in "My Computer." I enter the IP address and port of my server, select finish, 
and a list of folders on the Zope server appears. However, I find that I am unable to 
edit, or even copy, any of the Zope objects. I keep getting an error message "An error 
occured while trying to copy some or all of the selected files".

Here are my questions?

1. How is authentication being handled by my Zope server? Am I automatically 
authenticated to the server as the user I am logged on as on the local NT workstation? 
It never prompts me to identify myself via username and password. 

2. Can the world at large view my Zope site via WebDAV? It seems that I can connect to 
the server from multiple machines, even logged on as users who are not in the Zope 
acl_users folder...Is this the default behavior?

I have looked through the How-to's and performed searches on "Zope and WebDAV" in 
Google but haven't turned up much useful information. Can anyone offer any tips, or 
point me in the right direction on this?

Thanks in advance,
Darin Lee



___
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: Zope digest, Vol 1 #1019 - 28 msgs (I will be out of theoffice Monday, October 16th)office Monday, October 16th)

2000-10-17 Thread Darin Lee

I will be out of the office on Monday, October 16. If you require assistance, please 
contact the DEQ helpdesk at 241-7495.






___
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] Away Message (Apologies)

2000-10-17 Thread Darin Lee

Zopistas,

I apologize for the "Away" messages that have been popping up on the list. I needed to 
add a "zope.org" to my auto-response ruleset.
Unfortunately, I was away - and didn't realize this was happening. :-|

Sorry for all the noise,
-Darin Lee





Analyst / Web Administrator
Department of Environmental Quality
Office of Automation Coordination
Phone: (517) 241-5214
Fax: (517) 241-8379


___
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: Zope digest, Vol 1 #1018 - 39 msgs (I will be out of theoffice Monday, October 16th)office Monday, October 16th)

2000-10-16 Thread Darin Lee

I will be out of the office on Monday, October 16. If you require assistance, please 
contact the DEQ helpdesk at 241-7495.






___
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: Zope digest, Vol 1 #1017 - 17 msgs (I will be out of theoffice Monday, October 16th)office Monday, October 16th)

2000-10-15 Thread Darin Lee

I will be out of the office on Monday, October 16. If you require assistance, please 
contact the DEQ helpdesk at 241-7495.






___
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: Zope digest, Vol 1 #1016 - 28 msgs (I will be out of theoffice Monday, October 16th)office Monday, October 16th)

2000-10-14 Thread Darin Lee

I will be out of the office on Monday, October 16. If you require assistance, please 
contact the DEQ helpdesk at 241-7495.






___
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] New version of BTreeFolder. Just a Newbie Question

2000-08-28 Thread LEE Kwan Soo

Oh, well, I'd bet this is a silly question. But I can not resist nor find answer by 
myself.

Q: Why don't you BTree-fy all the subclasses of ObjectManager? 
Is there a reason that anyone but can a newbie see?

LEE Kwan Soo.

ps. I only hope to be able to make clear statement in English, but i am already too 
sleepy now. sorry.

- Original Message - 
From: "Shane Hathaway" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 28, 2000 10:26 PM
Subject: [Zope-dev] New version of BTreeFolder


 Hi gang,
 
 This version just fixes a bug with the folder contents tab on Windows. 
 For some reason, on Windows 95 (and perhaps other platforms) the Python
 interpreter behaves differently enough that if you use a class
 attribute from a different module and put it in your own class, you may
 in fact be modifying its global context.  It's probably a bug in
 Python.  As a workaround, this version of BTreeFolders doesn't have the
 "details" tab anymore.
 
 http://www.zope.org/Members/hathawsh/BTreeFolder/BTreeFolder-0.1.1.tar.gz
 
 BTW has anyone done any semi-formal speed tests?  It's rumored that a
 custom getattr in Python can cause a bit of a slowdown.  We could write
 a custom getattr in C to solve the problem.  But we don't want to do
 any premature optimization.
 
 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 )
 
 

___
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] Microsoft SQL Server Access under Linux?

2000-08-23 Thread Darin Lee

Zopistas,

Is it possible to access an ODBC data source through Zope running under Linux? I have 
perused the literature, and it appears the Zope DA's for ODBC only run under the Win32 
environment.

I would very much like to setup ZAP (for many reasons), but our "organizational 
standard" is MS SQL Server 6.5.

Thanks,
-Darin Lee




Darin M. Lee 
Analyst / Web Administrator
Office of Automation Coordination
Michigan Department of Environmental Quality
Phone: 517.241.5214
[EMAIL PROTECTED]

Darin M. Lee 
Analyst / Web Administrator
Office of Automation Coordination
Michigan Department of Environmental Quality
Phone: 517.241.5214
[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 )




[Zope] Broken Links and Orphan Checking

2000-08-11 Thread Darin Lee

Greetings,

Is there any way within Zope to parse HTML to look for broken links and orphaned 
files? The site I am building will have many Zope dynamic componants, but also a good 
share of wrapped static HTML pages maintained by content contributors in 
Frontpage/Dreamweaver. I know that orphaned files and broken links *will* become a 
problem over time.

Does anyone know of a good way to handle this?

Thanks,
-Darin M. Lee



Darin M. Lee 
Analyst / Web Administrator
Office of Automation Coordination
Michigan Department of Environmental Quality
Phone: 517.241.5214
[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 )




[Zope] LoginManager and ZPatterns - Sparse Install Docs, Help.

2000-08-05 Thread Darin Lee

Zopistas,

Maybe I'm making this harder than it needs to be.

I want to set up a membership system for the site I am developing with Zope.
I do not want to "restrict" any part of the site - instead I want a user to
login (at their convenience) and then extend the "menu" options based on
their group membership. If a user is not logged in - no problem, they just
won't be able to view the advanced options - they'll still be able to surf
the site (I want to maintain my user list in an external database as well).

What is the best tool in Zope to accomplish this? After searching the site,
I find there are several products - ACL Users, GUF, and LoginManager. Is GUF
deprecated (The intro tends to give me this feeling)? Is LoginManager the
way to go?

It also appears GUF is more tailored toward restrictive authentication (I've
already perused the "Using GUF with an SQL Database" how-to). I want a user
to login (via HTML form/cookie) whenever they like, and get presented with
additional menu options (based on their AUTHENICATED/GROUP status). Not have
them try to access a "restricted" page (or type "manage") and get a basic
authentication login box to get in.

As far as LoginManager itself is concerned, I assume it requires ZPatterns.
However, the Zpatterns install instructions are *very sparse.*  How do I get
the thing set up? Here's verbatim from the ZPatterns docs:

-
After unpacking the ZPatterns product, you will need to build this [c]
extension using the included Setup file in the ZPatterns directory.
-

How do I use the "Setup" file?? With the command "python Setup"? It doesn't
say *how* to use it.

-
Please follow the standard procedures for building a Python module on your
platform. (On Unix-ish systems, this usually consists of copying a
Makefile.pre.in to the directory, then doing a make -f Makefile.pre.in boot
followed by make.
-

What are these standard procedures?? I built Python itself with
"configure|Make|Make install". Where do I get this "Makefile.pre.in" file in
the first place, from my Python src/build directory?? Correct me if I'm
wrong, but there's usually some kind of script file to run that get's things
going, or a "configure" script. I find none of this in the
lib/python/Products/ZPatterns directory after I untarred it.

So, I'm basically stumped. It doesn't appear GUF will do what I need, and I
have failed on multiple attempts to get Loginmanager/ZPatterns installed. If
someone could point me in the right direction on this I sure would
appreciate it.

Thanks much,
-Darin Lee


___
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] PropertySheet Question

2000-07-17 Thread Darin Lee

Hi everyone,

I want to do something very simple: I have a ZClass propertysheet with an integer 
property called "views"
Every time I load the page, I would like to increment this value by one, and write it 
back to the propertysheet.
(Yep, a good old-fashioned access counter)


Sounds easy right?? Well, I can't seem to figure it out. Every time I get a little 
farther with Zope, something "trivial" like this completely knocks me for a loop and 
sends me hunting through piles of howto's for hours! argh...how hard can it be??

Got this from the help page (hopefully on the right track)...
manage_changeProperties(self, REQUEST=None, **kw): 

However, there is no clear example of how to call without a REQUEST object. I want to 
increment views, and then write it back to the property sheet. That's all. Do I need 
to include the asterisks? Do I need to include the keyword "self?" It really doesn't 
say. Everything I have seen on Zope.org, references the Web context with a REQUEST 
object.

Coming from the "Perl-CGI" world I can honestly say, Zope *feels* like it should be 
easier to develop with, but this learning curve is immense! 

Thanks for your patience,
Darin Lee (Zope Newbie Extraordinaire)





Darin M. Lee 
Analyst / Web Administrator
Office of Automation Coordination
Michigan Department of Environmental Quality
Phone: 517.241.5214
[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 )




[Zope] DTML Problem (from the newbie hair ripper category)

2000-07-16 Thread Darin Lee

Greetings,

I have created a custom Zclass called "Category." This object is based on
the "objectManager" template. Essentially this object is a container with a
few properties attached; "navigation_name" and "description."

Essentially, the gist of this is to create a navigation menu with a
dtml-in loop that displays all of the Category('s) in a given directory.
However, I want the property "navigation_name" to show up as the hyperlink
text. Does this make sense?

So, if I simply call the dtml-in "objectValues(['Category'])" and then
print the name with dtml-var navigation_name, everything works fine!!

Here is the proverbial rub. If I want to *test* for the presence of
"navigation_name" so I can print "title_or_id" if it's not defined, Zope
simply skips the "navigation_name" property. It's like it always evaluates
to false!

Example for "left navigation" dtml method:

dtml-in "objectValues(['Category'])"
 dtml-if "hasProperty('navigation_name')"
  dtml-var navigation_name
dtml-else
 dtml-var title_or_id
/dtml-if
/dtml-in

Okay, I think to myself "self, maybe acquisition is getting in the way," so
I try:

dtml-in "objectValues(['Category'])"
 dtml-with sequence-item
 dtml-if "hasProperty('navigation_name')"
  dtml-var navigation_name
dtml-else
 dtml-var title_or_id
/dtml-if
/dtml-with
/dtml-in

Doesn't work!

Could this have something to do with the definition of my own Zclass? Do I
have to read into the property sheet specifically? Is there a command for
that?

I took the example from the excellent "Breadcrumb Navigation Trail Howto"
and that works fine, as long as I use a supplied Zope object (like
"folder"). As soon as I use my own ZClasses, this breaks. (I'd like to get
my "navigation_name" into the breadcrumbs as well.

Thanks in advance,
-Darin Lee



___
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] Getting at Zope (Version) Transactions

2000-06-29 Thread Darin Lee

Hail Zopistas, 

I would like to develop a "what's new" method that parses/accesses the undo 
transactions list for certain documents so I can post basic information about when 
they were added, updated etc. in a DTML method for display on my index page. This 
would also come in very handy for a file-archive system I am planning on building. 
(I'm talking about the info that shows up when you hit the "undo" link in Zope 
manager).

Is there a way to get at the transaction data? Is this data stored after a version is 
merged back into the main ZOBD? What would be the best way in Zope to parse this log 
for certain types, and generate a DTML method? Does Zope support Regular Expressions?

I hail from the Perl coders guild (where generating and parsing text/sql is a 
relatively easy, albeit messy, task) - but am new to Python and OOP in general. 
However, now that I have Zoped, I can see there's no turning back.

Any help would be greatly appreciated!
-Darin Lee

Darin M. Lee 
Analyst / Web Administrator
Office of Automation Coordination
Michigan Department of Environmental Quality
Phone: 517.241.5214
[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 )




Re: [Zope] External Method Difficulties

2000-06-22 Thread Jason Lee

Dieter Maurer wrote:
   dtml-var genhash
 That should work.
 
 What KeyError do you get?
 The error message's head should tell you what key has not been
 found. The traceback at the foot (especially the last line)
 tells you where the KeyError occured.

After I posted, I did some more wild, random, send-up-a-prayer hacking and I
think I discovered the problem.  It appears that the name of the external method
and the name of the module file must be the same.  At least, I changed the name
of the file to genhash.py and things worked.  It could be that the file was
called md5.py, and since there is a Python module called md5, the interpreter
may have been getting confused.   I don't know which.  Can any one shed some
light on that?

Thanks for your help, Dieter!

-- 
Jason Lee   |Maybe it's good that I can't afford anti-psychotic 
[EMAIL PROTECTED]|medication. It frees me up to plan the assassination 
Programmer/Analyst  |of Deputy Dawg.  -- The Onion

___
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] External Method Difficulties

2000-06-21 Thread Jason Lee

For background purposes, I need to write a python module that will generate an
MD5 hash of a given string, and return the base 64 representation of that hash. 
The problem I am facing is getting my stub to work from my DTML document.  What
I have write now is a stub that takes no arguments and returns "Hello, World". 
When I click Try It from the management screen, it works fine, but I can't seem
to make it work from the DTML doc.  This is what Iv'e tried (I'm still pretty
new so I'm making wild guesses :)

dtml-call genhash

This produces nothing.  I think I read somewhere that dtml-call returns no data,
so that might explain it.  I could be wrong.

dtml-var genhash

This produces a KeyError.  It seems like I've tried a couple of other manglings,
but what they were escapes me for the moment.  I'm not passing a parameter right
now, cuz I wanted to simplify things once I found out it wasn't going to work
like I expected it to.  What am I doing wrong?  Is there a better place to start
than this list?  I have the content manager's guide and the dtml reference, but
I can't find anything helpful.  The ID for the external method is md5 in case
that helps.  Thanks a lot!

-- 
Jason Lee - Programmer/Analyst
The Fox and the Grapes: I'm not sure what the point is here. The moral 
is "It is easy to despise what you cannot get," but from experience I 
can tell you it's easy to despise what you do get as well, especially 
in terms of cable channels. -- The Brunching Shuttlecocks

___
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] Dynamically Picking which object to display

2000-06-07 Thread Jason Lee

I'm fairly new to Zope, so this may be a dumb question, and my vocabulary could
be wrong, so please bear with me.  

I'm in the middle of building an e-commerce solution for my company, and we're
evaluating Zope (and PHP and Servlets, but that's immaterial) as the platform on
which to base this solution.  That doesn't necessarily mean anything other than
to give you context.  One of the problems I'm facing right now is how to display
a particular object based on a value.  For example, let's say a user tries to
access www.foo.com/MyAccount/CCInfo.  If the user has authenticated, I need to
show him the obviously sensitive data he has requested.  If he is not
authenticated, however, I need to give him a login screen which, for argument's
sake, is in the DTML document Login in the root folder.  How would I go about
doing that?  Am I making sense?  Thanks...

-- 
Jason Lee  | My German is as good as my jujitsu, which is to say, 
Programmer/Analyst | "I don't know German." -- Tycho Brahe

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