[Zope] How to display image returned from Catalog query

2001-01-30 Thread Timothy Wilson

Hey everyone,

I've got a PythonScript that returns a list of 'Photo' instances. I'm using

dtml-in returnPOTD size="1" orphan="0"

to grab the first instance off the list.

What I can't figure out is how to display that image. I can use

a href="dtml-absolute_url;"dtml-var title/a

to make a link to the image, but I want this method to display the image
directly.

dtml-var sequence-item returns the instance itself and doesn't display
anything. I'm sure there's something simple I'm missing here. Any
suggestions?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] How to display image returned from Catalog query

2001-01-30 Thread Timothy Wilson

On Tue, 30 Jan 2001, Oleg Broytmann wrote:

 On Tue, 30 Jan 2001, Timothy Wilson wrote:
  What I can't figure out is how to display that image. I can use
 
  a href="dtml-absolute_url;"dtml-var title/a
 
  to make a link to the image, but I want this method to display the image
  directly.
 
img src="dtml-absolute_url;" ?

Doh! I was trying to do too much with DTML. Thanks for the tip!

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] Is it possible to use regular CGI's like htDig withzserver?

2001-01-29 Thread Timothy Wilson

On Mon, 29 Jan 2001, Chris Withers wrote:

  And if so, how would I set that up?
 
 -Use Apache as your main server.
 -Use mod_proxy(?) to proxypass Zope requests through to ZServer.
 -install htdig as a normal CGI under Apache

Presumably, then, this would be the same approach for getting Mailman
working alongside Zope?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] Picture of the day product

2001-01-29 Thread Timothy Wilson

On Mon, 29 Jan 2001, Tres Seaver wrote:

  I'd like to grab all instances with a display_date = today's
  date. I can't figure out exactly how to do that in DTML or a
  Python Script. Once I have that list of instances, I'll simply
  pull off the latest one as you suggested.

 I don't know where it would be in the book it would be, but
 I do this something like::
 
   dtml-in expr="theCatalog( meta_type='Photo'
, display_date=ZopeTime()
, display_date_usage='range:max'
, sort_on='display_date'
, sort_order='reverse'
)"
 
 The expression would be basically the same in a PythonScript::
 
   return context.theCatalog( meta_type='Photo'
, display_date=ZopeTime()
, display_date_usage='range:max'
, sort_on='display_date'
, sort_order='reverse'
)

Great! The first DTML example works perfectly. The second, however, throws
up an error. In fact, I have yet to figure out how to use ZopeTime() in a
PythonScript. Do I have to pass anything in? 

I get:

Error Type: NameError
Error Value: ZopeTime

when I try it.

-Tim

 Hope that helps!

Thanks again. I should have those pictures up in no time.

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] PythonScript question

2001-01-27 Thread Timothy Wilson

Hi everyone,

I'm using the Photo product to diplay some pictures at various resolutions
and to display them on a certain date. (Some may recall my questions about a
"Picture of the day" recently.) I want to set a 'display_date' property for
each Photo instance and I'd like to do it using a PythonScript. I've created
a form and PythonScript, but I get this error:

Error Type: TypeError
Error Value: argument 1: expected read-only character buffer, instance found

and this traceback:

Traceback (innermost last):
  File /var/lib/zope/2.3.0/lib/python/ZPublisher/Publish.py, line 222, in
publish_module
  File /var/lib/zope/2.3.0/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /var/lib/zope/2.3.0/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
  File /var/lib/zope/2.3.0/lib/python/ZPublisher/Publish.py, line 171, in
publish
  File /var/lib/zope/2.3.0/lib/python/ZPublisher/mapply.py, line 160, in
mapply
(Object: POTD_add)
  File /var/lib/zope/2.3.0/lib/python/ZPublisher/Publish.py, line 112, in
call_object
(Object: POTD_add)
  File /var/lib/zope/2.3.0/lib/python/Shared/DC/Scripts/Bindings.py, line
324, in __call__
(Object: POTD_add)
  File /var/lib/zope/2.3.0/lib/python/Shared/DC/Scripts/Bindings.py, line
353, in _bindAndExec
(Object: POTD_add)
  File
/var/lib/zope/2.3.0/lib/python/Products/PythonScripts/PythonScript.py, line
330, in _exec
(Object: POTD_add)
(Info: ({'script': PythonScript instance at 87874d0,
'context': Folder instance at 89506c0, 'container': Folder instance at
89506c0, 'traverse_subpath': []}, ('This is a test',
DateTime('2001/01/30'), ZPublisher.HTTPRequest.FileUpload instance at
869e170), {}, None))
  File Script (Python), line 8, in POTD_add
TypeError: (see above)

Here's the relevant part of the form:

form action="POTD_add" method="post" enctype="multipart/form-data"
table
tr
 th align="right"Caption/th
 tdinput type="text" name="title" size="50" value=""/td
/tr
tr
 th align="right"Display Date/th
 tdinput name="display_date:date" size="20" value=""/td
/tr
tr
 th align="right"Image/th
 tdinput type="file" name="file" size="25" value=""/td
/tr
tr
 tdnbsp;/td
 tdbrinput type="submit" value=" Add POTD "/td
/tr
/table
/form

And here's my PythonScript 'POTD_add' to which I pass the parameter list 
'title, display_date, and file':

"""
Create a "Picture of the Day" image.
"""
import string

# create a unique object id based on the display date
newID = string.split(display_date, '/')
id = ''
for i in newID:
  id = id + str(i)

# create the image
context.manage_addProduct['OFSP'].manage_addPhoto(id, title=title,
file=file)

# add a display date property
doc = getattr(context, id)
doc.manage_addProperty('display_date', display_date, 'date')

Any ideas?

Wouldn't it would be great if there was a PythonScript repository
somewhere? It would help me a ton.

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/




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




Re: [Zope] Editors [OT]

2001-01-26 Thread Timothy Wilson

On Fri, 26 Jan 2001, Phil Harris wrote:

 You could use STunnel to wrap Zope in SSL, www.stunnel.org.

Phil,

Could you expand on this a bit? I would be very interested in wrapping all
access to "manage" in SSL. Is that possible?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] Source to www.zope.org

2001-01-21 Thread Timothy Wilson

On Sun, 21 Jan 2001, Gerald Gutierrez wrote:

 Is the source code to www.zope.org available somewhere?

At the bottom of the page there's a link called "View Source" which will
give you the original DTML. You can tack 'view_source' onto the end of any
www.zope.org URL to see how it was built.

You're right. It's very handy.

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] batch processing problem

2001-01-20 Thread Timothy Wilson

Hi everyone,

I was trying to throw together a page with some pictures of my brand-new
nephew for his parents to show to relatives. What should have been a
relatively simple dtml-in iteration through a folder full of images has
turned out to be headache inducing. I'm sure that there's something I'm just
not understanding, but I can't figure out why the following doesn't
work. I've tried many different combinations without success. You can see it
for yourself at http://208.42.140.222:9673/olsen/cullypics/ (Sorry, DNS
problems.)

dtml-var standard_html_header

h2 align="center"Cullin Isaac Olsen/h2
h3 align="center"January 17, 2001br8 lb. 1 oz., 22 in./h3
br

table align="center" cellspacing="10"
dtml-in "PARENTS[0].objectValues(['Image'])" size=1 start=query_start
sort=display_order
tr
 td colspan="2"
  span style="font: bold larger Verdana, Arial, Helvetica,
sans-serif"Picture #dtml-var display_order/spanbr
  a href="fullsize/dtml-var id_fullsize"dtml-var sequence-item/a
  dtml-if titleh4 align="center"dtml-var title/h4/dtml-if
 /td
/tr
tr
 td
  dtml-if previous-sequence
   p align="left"a href="dtml-var URLdtml-var
sequence-queryquery_start=dtml-var previous-sequence-start-number"p
align="left"Previous picture/a/p
  dtml-else
   nbsp;
  /dtml-if previous-sequence
 /td
 td
   dtml-if next-sequence
p align="right"a href="dtml-var URLdtml-var
sequence-queryquery_start=dtml-var next-sequence-start-number"
   Next picture/a/p
   dtml-else
nbsp;
   /dtml-if next-sequence
 /td
/tr
/dtml-in
/table

dtml-var standard_html_footer

Any ideas?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] Picture of the day product

2001-01-18 Thread Timothy Wilson

On Thu, 18 Jan 2001, Tres Seaver wrote:

 Subclassing Image might be useful, but you could certainly
 get by without if, if all you need is to add a property or
 two:  Images have a propertysheet to which you could add them.

But if I use the standard Image meta type, wouldn't I have to create a
'display_date' property by hand each time I upload an image? I suppose it
would be possible to create an HTML form that would add that property for
me. I'm not sure I want to catalog every image on my site so another for
creating a separate product would be that I could make it catalog-aware on
its own. Comments?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] Picture of the day product

2001-01-18 Thread Timothy Wilson

On Thu, 18 Jan 2001, Tres Seaver wrote:

   This kind of thing is a "query-on-metadata" application;  I
   would put all these images into a single folder (maybe
   chunked into subfolders by month?), mark them each with an
   'effective' property (of type 'Date'), and then select the
   appropriate image via a catalog query, e.g.::
   
 dtml-in "Catalog( meta_type='Image'
  -- rest of example snipped --

Another followup: How 'bout using PIL to generate the thumbnail version that
displays on the homepage as link to the fullsize picture and the
archives? Would this be a logical place to begin experimenting with 2.3.0's
new caching mechanism? Comments?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] Picture of the day product

2001-01-17 Thread Timothy Wilson

Hey everyone,

I was looking at linux.com the today and I noticed their "Daily Photo." I
occurred to me that that would be a fun addition to the school's page that
I'm developing. My first thought would be to:

* inherit from Image
* add caption, date taken, etc. properties
* create an archive of past photos

What I'm not sure about is how to have Zope automatically display the photo
for a day, then archive it. Would a boolean property of the ZClass work? Is
it possible to have Zope set the property of a ZClass instance at certain
time? Any thoughts on how this would be designed?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] Picture of the day product

2001-01-17 Thread Timothy Wilson

On Wed, 17 Jan 2001, Tres Seaver wrote:

  What I'm not sure about is how to have Zope automatically display the photo
  for a day, then archive it. Would a boolean property of the ZClass work? Is
  it possible to have Zope set the property of a ZClass instance at certain
  time? Any thoughts on how this would be designed?
 
 This kind of thing is a "query-on-metadata" application;  I would
 put all these images into a single folder (maybe chunked into
 subfolders by month?), mark them each with an 'effective' property
 (of type 'Date'), and then select the appropriate image via a
 catalog query, e.g.::
 
   dtml-in "Catalog( meta_type='Image'
-- rest of example snipped --

Are you suggesting I use the standard Image class? What about subclassing
Image so I can add a display_date property and whatever else I might need?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] ZClasses meet PythonScripts, sample request

2001-01-15 Thread Timothy Wilson

Jim (or anyone else who's feeling charitable this morning),

Thanks for all your help. I really appreciate it. I wonder if you'd have
time to look one more time at the two methods I've got that aren't
working. I've included the actual code for my job posting product. Perhaps
someone will find it instructive. I have a feeling that the remaining
problem is not directly related to the processing of the form by the
PythonScript. I also included the traceback at the end of this message.

Here are the two methods. I have a table that displays the currently
available jobs and displays two little icons which call the edit or delete
methods on the corresponding instance of the 'Job Posting' class. The edit
icon links to the 'editJobForm' method which in turn calls the
'editFormAction' method that actually processing the change.

--
editJobForm
-

dtml-var standard_html_header

h2Edit a Job Board Entry/h2
pThis form allows you to make changes to current postings on the online
job board. You don't needed to fill in every 
field on the form. Click on the "Submit Edits" button at the bottom of the
screen to save your changes to the database./p

dtml-if "REQUEST.form.has_key('editJob')"
dtml-call "editFormAction(REQUEST)"
pfont color="red"Your changes have been saved/font/p
/dtml-if

form action="editJobForm"
table border="0"

trthNotes/th
tdtextarea name="notes:text" rows="10" cols="60" wrap="virtual"dtml-var
notes/textarea/td
/tr
trthJob ID/th
tdinput type="text" name="id" size="20" value="dtml-var id"/td
/tr
trthOrganization/th
tdinput type="text" name="organization" size="60" value="dtml-var
org_name"/td
/tr
trthPosition/th
tdinput type="text" name="position" size="60" value="dtml-var
name"/td
/tr
trthDescription/th
tdtextarea
name="description:text" rows="10" cols="60" wrap="virtual"dtml-var
description/textarea/td
/tr
trthPay Offered/th
tdinput type="text" name="pay" size="60" value="dtml-var pay"/td
/tr
trthLine of Authority/th
tdinput type="text" name="loa" size="60" value="dtml-var loa"/td
/tr
trthFunction/th
tdtextarea
name="function:text" rows="4" cols="60" wrap="virtual"dtml-var
function/textarea/td
/tr
trthQualifications/th
tdtextarea
name="qualifications:text" rows="8" cols="60" wrap="virtual"dtml-var
qualifications/textarea/td
/tr
tr
td colspan=2
pTo create a bullet list of "duties," type each one in the box below and
press the "ENTER" key 
between each item in the list./p
/td
/tr
trthDuties/th
dtml-if duties
tdtextarea name="duties:list" rows="10" cols="60" wrap="virtual"dtml-in
dutiesdtml-let item=sequence-itemdtml-if item
dtml-var item
/dtml-if/dtml-let/dtml-in/textarea/td
dtml-else
tdtextarea
name="duties:list" rows="10" cols="60" wrap="virtual"/textarea/td
/dtml-if
/tr
trthOffer Expires/th
tdinput type="text" name="expires" size="20" value="dtml-var
offer_expires fmt="%m/%d/%Y""/td
/tr
tr
td colspan=2pEnter the date that the job was officially posted./p/td
/tr
trthPosted Date/th
tdinput type="text" name="posted" size="20" value="dtml-var date_posted
fmt="%m/%d/%Y""/td
/tr
tr
tdnbsp;/td
td
input type="submit" name="editJob" value=" Submit Edits "
/form
form action="admin_html"
input type="submit" value=" Cancel "
/form
/td
/tr
/table

dtml-var standard_html_footer

-
editFormAction (with REQUEST as a parameter)
-

container.propertysheets['job_info'].manage_changeProperties(REQUEST)


The error I get is:

 Error Type: TypeError
Error Value: sequence index must be integer

Traceback:

Traceback (innermost last):
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 222, in
publish_module
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /var/lib/zope/2.3.0a2/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 171, in
publish
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/mapply.py, line 160, in
mapply
(Object: editJobForm)
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 112, in
call_object
(Object: editJobForm)
  File /var/lib/zope/2.3.0a2/lib/python/OFS/DTMLMethod.py, line 189, in
__call__
(Object: editJobForm)
  File /var/lib/zope/2.3.0a2/lib/python/DocumentTemplate/DT_String.py, line
538, in __call__
(Object: editJobForm)
  File /var/lib/zope/2.3.0a2/lib/python/DocumentTemplate/DT_Util.py, line
336, in eval
(Object: editFormAction(REQUEST))
(Info: REQUEST)
  File lt;stringgt;, line 0, in ?
  File /var/lib/zope/2.3.0a2/lib/python/Shared/DC/Scripts/Bindings.py, line
325, in __call__
(Object: editFormAction)
  File /var/lib/zope/2.3.0a2/lib/python/Shared/DC/Scripts/Bindings.py, line
354, in _bindAndExec
(Object: editFormAction)
  File
/var/lib/zope/2.3.0a2/lib/python/Products/PythonScripts/PythonScript.py,
line 321, in _exec
(Object: editFormAction)
(Info: ({'script': lt;PythonScript instance at 8826790gt;,

Re: [Zope] ZClasses meet PythonScripts, sample request

2001-01-15 Thread Timothy Wilson

On Mon, 15 Jan 2001, Jim Washington wrote:

 One point about your form:
 
 You have id as a form variable.  You will be disappointed by its
 behavior.

Thanks Jim.

Care to elaborate on the problems with using id as a form variable.

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] ZClasses meet PythonScripts, sample request

2001-01-15 Thread Timothy Wilson

On Mon, 15 Jan 2001, Jim Washington wrote:

 What is the name of the propertysheet in your ZClass that these values
 are on?  Is it 'job_info'?

Yes.

 Where is the editFormAction Python Script? It should be in your ZClass's
 /methods.  If you are instead acquiring it from a Folder somewhere, you
 will need to use 'context' instead of 'container' inside the Python
 Script.

I had them originally in the ZClass's /methods, but moved them out.

That brings up another good question that I haven't really seen
addressed. Hopefully others are still reading this thread. :-)

When is it proper to make your methods part of the ZClass itself and when
should I put them out in a folder somewhere to be acquired? I've seen it
done both ways in various products, but the difference between the two
approaches has never been completely clear to me.

Can anyone suggest a "rule-of-thumb" here?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] How to display only x records with dtml-in

2001-01-15 Thread Timothy Wilson

Hey everyone,

I've got a method to display some text which uses 
dtml-in "objectValues(['Spam and Eggs'])"
to iterate through a bunch of "Spam and Eggs" ZClass instances. I thought
that I could use size="2" in the dtml-in to display only the first two
instances, but it's not working. I want to display only the first two and
use a link at the bottom to direct people to see the rest on a separate
page. Any ideas?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] ZClasses meet PythonScripts, sample request

2001-01-14 Thread Timothy Wilson

On Sun, 14 Jan 2001, Jim Washington wrote:

 I am not working through that example, but the below is a start on what
 you seem to need. Let me know what you think.

Thanks Jim. I will study the examples you provided. Do you suppose that the
Zope Book would benefit from some examples of this type?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] ZClasses meet PythonScripts, sample request

2001-01-14 Thread Timothy Wilson

On Sun, 14 Jan 2001, Jim Washington wrote:

 You probably want the work to be done in the context of an instance of
 the class, so assure you have "context" bound to the Python Script on
 the "bindings" tab.  It's bound by default.
 
 You might want to name the Script in a Zopish way to distinguish it from
 other scripts that may do other things.  I would probably call it
 manage_changeCDProperties.
 
 You will want to pass REQUEST to it so you can use it like the Zope
 builtins:
 
 containerName.CDInfoName.manage_changeCDProperties(REQUEST)
 
 So, put REQUEST in the parameters list.

I'm afraid I'm a bit confused here. Is 'CDInfoName' the id of an instance of
this CD class? If so, what would 'containerName' be?

In the particular example I'm thinking about (not a CD collection), I've
created a form that displays the current properties of the class (a job
opening for the H.R. deparment in my case), allows the user to modify any of
the properties in the form, and submit those changes. I suppose for the CD
example it would something like: (ignoring everything but the form)

form action="manage_changeCDProperties(REQUEST)"
table border="0"

trthTitle/th
  tdinput type="text" name="title" value="dtml-var title"/td
/tr

trthArtist/th
  tdinput type="text" name="artist" value="dtml-var artist"/td
/tr

trtd
input type="submit" value=" Submit Edits "
/td/tr
/table
/form

I don't think I'm calling the PythonScript correctly. In fact, I suspect I'm
quite a bit off.

 Inside the script, you would use Zope's manage_changeProperties method:
 
 context.propertysheets['cd_info'].manage_changeProperties(REQUEST)
 -or-
 context.propertysheets.cd_info.manage_changeProperties(REQUEST)

Following Evan's advice, would this then be:

container.propertysheets['cd_info'].manage_changeProperties(REQUEST)

So that's a one-liner? Hmmm. Cool if true. :-)

Let's say that I wanted to redirect the user back to the Web page where they
had begun this process. How would that be accomplished?

-Tim

 Timothy Wilson wrote:
  
  Hi everyone,
  
  I'm looking forward to using some PythonScripts as methods of some ZClasses
  because it seems like a much cleaner way to do things. I wonder if one of
  the PythonScript gurus out there would be willing to show an example of two
  presumably common PythonScript/ZClass tasks: processing changes to a
  property sheet using form input and deleting a ZClass instance.
  
  Let's say we've got a ZClass for keeping track of a CD collection. (I recall
  seeing that example in a ZClass How-To.) Let's say the ZClass has a property
  sheet called 'cd_info' with the following properties:
  
  title (string)
  artist (string)
  date_purchased (date)
  
  (for extra credit, add a 'songs' property of type 'lines' :-)
  
  Is that enough info? Anybody want to take a crack at this? (This would
  surely be good info to put at zope.org somewhere.)
  
  -Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] ZClasses meet PythonScripts, sample request

2001-01-14 Thread Timothy Wilson

This seems to almost work. :-)

On Sun, 14 Jan 2001, Jim Washington wrote:

 !dtml-var standard_html_header
 
 !dtml-if "REQUEST.form.has_key('editCD')"
 !  dtml-call "manage_changeCDProperties(REQUEST)"
 !  pfont color="red"Your changes have been saved/font/p
 !/dtml-if
 
 !form action="replace_this_with_id_of_this_method"
  table border="0"
  
  trthTitle/th
   tdinput type="text" name="title" value="dtml-var title"/td
  /tr
  
  trthArtist/th
tdinput type="text" name="artist" value="dtml-var artist"/td
  /tr
  
  trtd
 ! input type="submit" name="editCD" value=" Submit Edits "
  /td/tr
  /table
  /form
 !dtml-var standard_html_footer

That's quite clever. I wouldn't have thought of doing it that way.

After translating the CD example to my own ZClass, I get the following error
after hitting "Submit Edits" on the edit form:

h2Zope Error/h2
pZope has encountered an error while publishing this resource.
  /p
pstrongResource not found/strong/p
Sorry, the requested Zope resource does not exist.pCheck the URL and try
again.p
!--
http://www.isd197.k12.mn.us/hr/jobs/postings/1234/editJobAction%28REQUEST%29
--

and the traceback:

Traceback (innermost last):
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 222, in
publish_module
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /var/lib/zope/2.3.0a2/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 162, in
publish
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/BaseRequest.py, line 369,
in traverse
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/HTTPResponse.py, line
528, in notFoundError
NotFound: (see above)

It looks like REQUEST isn't getting passed correctly. I've got REQUEST
listed as a parameter for my PythonScript. I don't need to mess with
bindings do I?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] ZClasses meet PythonScripts, sample request

2001-01-13 Thread Timothy Wilson

Hi everyone,

I'm looking forward to using some PythonScripts as methods of some ZClasses
because it seems like a much cleaner way to do things. I wonder if one of
the PythonScript gurus out there would be willing to show an example of two
presumably common PythonScript/ZClass tasks: processing changes to a
property sheet using form input and deleting a ZClass instance.

Let's say we've got a ZClass for keeping track of a CD collection. (I recall
seeing that example in a ZClass How-To.) Let's say the ZClass has a property
sheet called 'cd_info' with the following properties:

title (string)
artist (string)
date_purchased (date)

(for extra credit, add a 'songs' property of type 'lines' :-)

Is that enough info? Anybody want to take a crack at this? (This would
surely be good info to put at zope.org somewhere.)

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] Has MailHost API changed?

2001-01-12 Thread Timothy Wilson

Hi everyone,

I had a perfectly functioning MailHost object until recently. Site visitors
could email feedback to me from the Web page with no trouble. I can't pin it
down exactly, but the breakage seems to coincide with a upgrade to 2.2.4 a
while ago. The problem also exists in 2.3.0a2. Here's the traceback I get:

!--
Traceback (innermost last):
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 222, in
publish_module
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /var/lib/zope/2.3.0a2/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 171, in
publish
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/mapply.py, line 160, in
mapply
(Object: sendfeedback)
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 112, in
call_object
(Object: sendfeedback)
  File /var/lib/zope/2.3.0a2/lib/python/OFS/DTMLDocument.py, line 176, in
__call__
(Object: sendfeedback)
  File /var/lib/zope/2.3.0a2/lib/python/DocumentTemplate/DT_String.py, line
538, in __call__
(Object: sendfeedback)
  File /var/lib/zope/2.3.0a2/lib/python/Products/MailHost/SendMailTag.py,
line 182, in render
(Object: MailHost)
KeyError: (see above)

--

Here's the method I use to send email:

dtml-var standard_html_header

dtml-sendmail mailhost="MailHost" 
To: Feedback Recipient [EMAIL PROTECTED] 
From: dtml-var visitor_email 
Subject: Feedback from the web 

Feedback from : dtml-var visitor_name
Comments:
dtml-var comments 
/dtml-sendmail 

table
tr
 dtml-var district_links
 td valign=top
H3Thank you for your input!/H3

Your message has been sent.
BRBR
CENTERa href=http://www.isd197.k12.mn.us/Click here to return to the
home page./a/CENTER

 /td
/tr
/table
dtml-var standard_html_footer

Anybody see a problem?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/



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




[Zope] Design/DTML question

2001-01-10 Thread Timothy Wilson

Hi everyone,

I'm working on a Web page for our local school board. I'd like to create a
table that would display links to past board meeting minutes. The table
would look like this: (Note: dates are bogus)

+---+
| Meeting Minutes   |
|   |
| Monday, Jan. 10  Monday, Mar. 7   |
| Tuesday, Jan. 24 Monday, Mar. 20  |
| Monday, Feb. 7   Monday, Apr. 5   |
| Monday, Feb. 27  Tues., Apr. 19   |
|   |
|1999 | 2000 | 2001 |
+---+

By default, dates for the current year would be displayed, but clicking on
the years at the bottom of the table would display those dates.

Right now, I've got the dates stored in a TinyTable. I can iterate through
that list and generate the links, but I can't figure out how to display the
table in two columns.

dtml-in meetingDateTable
 trtddtml-var meeting_date/td/tr
/dtml-in

will print the dates in a single column, but how can I iterate through and
refer to two different dates in one dtml-in pass? (Does that make sense?)

The second thing I'm tring to figure out is how to make the year links at
the bottom generate the new table of dates from a different TinyTable. Maybe
I should use the same TinyTable for all of the meeting dates and pull out
whichever year I need when the table is rendered.

I'm also wondering if I should implement these meeting minutes and agendas
in a ZClass. At first it seemed like this would be too simple to bother
with, but now I'm wondering if a ZClass would be a better approach. I'd
appreciate any comments.

-Tim 

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




RE: [Zope] Design/DTML question

2001-01-10 Thread Timothy Wilson

On Wed, 10 Jan 2001, Dennis Nichols wrote:

 Or, if you insist that dates flow down the columns like I do, you could use 
 this untested revision of Max's solution:
 
 table width=100% border=0 cellpadding=4
tr align=left valign=top
  td width=50%
dtml-in meetingDateTable
  dtml-if "_.int(_['sequence-index'])*2==_.int(_['count-id']) or
_.int(_['sequence-index'])*2==_.int(_['count-id'])+1"
/tdtd width=50% !-- moved to next column --
  /dtml-if
  dtml-var meeting_datebr
/dtml-in
  /td
/tr
 /table

This doesn't seem to work. The if statement only evaluates to true the first
time through the loop. I agree that the dates must flow down, so don't I
need to have some way to do the following:

table
dtml-in meetingDateTable
tr
 tddtml-var meeting_date/td
 tddtml-var meeting_date[some later index]/td
/tr
/dtml-in
/table

It's the [some later index] part that would seem to be the
bugger. Doable? Perhaps this would be a perfect application for a
PythonScript?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] SiteAccess and 2.3.0a2

2001-01-10 Thread Timothy Wilson

Hi everyone,

I have Evan's excellent SiteAccess product installed on my 2.3.0a1 Zope as
an add-on. Now that SiteAccess is part of the Zope core, how should I handle
the upgrade. Can I simply recompile?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] reporting 2.3.0a1 bugs

2000-12-31 Thread Timothy Wilson

Hey everyone,

I've discovered a couple problems with 2.3.0a1. Should those be submitted to
the collector, or is there somewhere else to report problems with
development versions?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] Newbie question - Link between Methods based on Authorization

2000-12-19 Thread Timothy Wilson

On Tue, 19 Dec 2000, Michal Krejza wrote:

 I have problem with access to method. Example - There are two methods: A and
 B. Method A contains common information, accessible for all user (include
 anonymous). Source code in method B updates data for method A and access for
 method B is restrict only for users with roles "AdminTables". There is a
 link from method A to method B in the code of script A, and this link is
 viewable for all user (also for anonym). After click on this link, user is
 asked for authentication. So there is no problem, but HOW MAKE THIS LINK
 VIEWABLE ONLY FOR USER WITH AUTORIZATION FOR OBJEKT B ???

Hello Michal,

This may work:

dtml-if "AUTHENTICATED_USER.has_role('AdminTables', this())"
 a href="/link/to/method/B"Method B/a
/dtml-if

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] user property sheets

2000-12-18 Thread Timothy Wilson

Hey everyone,

I'd like to make a product so that Zope users' contact info would be
available on a "MemberBio" page whenever you click on a hyperlink of their
name. The MemberBio page would also contain a form that could be used to
send them email.

I know there's been some discussion of property sheets for Zope users, but I
don't know if this would be the correct approach. Should I create something
totally separate, use property sheets, or some combination. The advantage of
a separate product is that the person wouldn't have to exist as an official
Zope user to have a "MemberBio" page. Any advice?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] Pesky DateTime problem

2000-12-15 Thread Timothy Wilson

Hi everyone,

I would *really* appreciate some advice about a problem with a ZClass I
created. This product is a Job Board that our H.R. department can use to
post openings and the public can view. I began by looking at the very nice
"Build a Searchable Job Board" How-To at
http://www.zope.org/Members/mukhsein/job_board_howto and combined that with
the ZClass approach put forward in the Beehive ZClass documentation.

The problem lies in adding an instance of the job board ZClass at which
point Zope reports an "Invalid Date-Time String". At the risk of providing
too much information, I'm going to include some of the relevant methods and
the traceback. I would love it if someone could spot my error. (Why do I
have this feeling that it's something really simple and that I'm an even
larger moron than my friends and acquaintances assume me to be? :-)

Here the traceback:

!--
Traceback (innermost last):
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/Publish.py, line 222, in
publish_module
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /var/lib/zope/2.2.2/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/Publish.py, line 171, in
publish
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/mapply.py, line 160, in
mapply
(Object: entry_addProcessor)
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/Publish.py, line 112, in
call_object
(Object: entry_addProcessor)
  File /var/lib/zope/2.2.2/lib/python/OFS/DTMLMethod.py, line 172, in
__call__
(Object: entry_addProcessor)
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_String.py, line
528, in __call__
(Object: entry_addProcessor)
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_With.py, line 146,
in render
(Object: manage_addProduct['JobBoard'])
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_Util.py, line 337,
in eval
(Object: job_board_entry_add(_.None,_, NoRedir=1))
(Info: _)
  File lt;stringgt;, line 0, in ?
  File /var/lib/zope/2.2.2/lib/python/OFS/DTMLMethod.py, line 168, in
__call__
(Object: job_board_entry_add)
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_String.py, line
528, in __call__
(Object: job_board_entry_add)
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_With.py, line 146,
in render
(Object: job_board_entry.createInObjectManager(REQUEST['jobID'],
REQUEST))
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_Util.py, line 337,
in eval
(Object: propertysheets.entry_info.manage_editProperties(REQUEST))
(Info: REQUEST)
  File lt;stringgt;, line 0, in ?
  File /var/lib/zope/2.2.2/lib/python/OFS/PropertySheets.py, line 459, in
manage_editProperties
(Object: Traversable)
  File /var/lib/zope/2.2.2/lib/python/OFS/PropertySheets.py, line 286, in
_updateProperty
(Object: Traversable)
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/Converters.py, line 173, in
field2date
  File /var/lib/zope/2.2.2/lib/python/DateTime/DateTime.py, line 698, in
__init__
Invalid Date-Time String: (see above)

--

Here's the job_board_entry_add method that lives in
Control_Panel/Products/JobBoard/:

HTML
HEADTITLEAdd job_board_entry/TITLE/HEAD
BODY BGCOLOR="#FF" LINK="#99" VLINK="#55"

dtml-with "job_board_entry.createInObjectManager(REQUEST['jobID'],
REQUEST)"
dtml-call "propertysheets.entry_info.manage_editProperties(REQUEST)"
/dtml-with

dtml-if NoRedir
dtml-else
dtml-if DestinationURL

dtml-call "RESPONSE.redirect(DestinationURL+'/manage_workspace')"

dtml-else

dtml-call "RESPONSE.redirect(URL2+'/manage_workspace')"
/dtml-if
/dtml-if
/body/html

Here's the "Add a Job Posting" form that the H.R. people use:

dtml-var standard_html_header

h2Add a Job Board Entry/h2
pThis form will create a new job posting for the online job board. You
don't needed to fill in every 
field on the form. Click on the "Add Entry" button at the bottom of the
screen to add the posting to the database./p

form action="entry_addProcessor"
table border="0"

trthJob ID/th
tdinput type="text" name="new_jobID" size="20"/td
/tr
trthOrganization/th
tdinput type="text" name="new_organization" size="60"/td
/tr
trthPosition/th
tdinput type="text" name="new_position" size="60"/td
/tr
trthDescription/th
tdtextarea
name="new_description:text" rows="10" cols="60" wrap="virtual"/textarea/td
/tr
trthPay Offered/th
tdinput type="text" name="new_pay" size="60"/td
/tr
trthLine of Authority/th
tdinput type="text" name="new_loa" size="60"/td
/tr
trthFunction/th
tdtextarea
name="new_function:text" rows="4" cols="60" wrap="virtual"/textarea/td
/tr
trthQualifications/th
tdtextarea
name="new_qualifications:text" rows="8" cols="60" wrap="virtual"/textarea/td
/tr
tr
td colspan=2
pTo create a bullet list of "duties," type each one in the box below and
press the "ENTER" key 
between each item in the list./p
/td
/tr
trthDuties/th
tdtextarea
name="new_duties:text" rows="10" 

Re: [Zope] Pesky DateTime problem

2000-12-15 Thread Timothy Wilson

On Fri, 15 Dec 2000, seb bacon wrote:

  The problem lies in adding an instance of the job board ZClass at which
  point Zope reports an "Invalid Date-Time String".
 
 You might have considered this already, but you're not supplying a 
 default date in the DateTime field of the form.  This can cause problems, 
 because there's a bug in zope that won't allow null values in DateTime 
 properties.  

I thought that was only a problem when defining the list of properties
initially. I didn't think you had to supply a default when creating actual
instances of the class.

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] Problem with 2.2.2 and date properties?

2000-10-12 Thread Timothy Wilson

Hi everyone,

I'm having trouble with a ZClass I've created that uses, among others, two
date properties. I'm suddenly having problems creating new instances or
working with existing instances of my ZClass. I can't be sure, but it seems
like the onset of the problems coincided with my upgrade to 2.2.2. Has
anyone else seen any problems with date properties and Zope 2.2.2?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] Using ProxyPass and SiteRoot

2000-10-11 Thread Timothy Wilson

Hi everyone,

I've read the "Using Apache with ZServer (NOT Zope.cgi)" How-To and I find
that my situation is different enough from the ones described that I'm not
having any luck setting it up. I'd appreciate any suggestions on the
following:

My current Zope site is at http://www.isd197.k12.mn.us/ which uses
Zope.cgi. There are a number of other static, non-Zope virtual hosts running
on that same machine representing a number of our elementary schools.

I've been developing a new Zope site on a separate machine at
http://206.131.108.103:8080/ using just ZServer and I would like to use
ProxyPass to pass a request for www.isd197.k12.mn.us through to this new
site.

Can someone suggest ProxyPass and SiteRoot settings that will make this
work?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] sudden ZClass breakage

2000-10-05 Thread Timothy Wilson

Hi everyone,

I've been working away on a ZClass-based product that will provide a
searchable job board for our Human Resources Dept. here at school. Things
were going along fine until, it seemed, out of the blue I started getting an
error message about an "Invalid Date-Time String" and a lengthy
traceback. I'm wondering if anyone can glean anything from the
traceback. Is this one of those obvious errors that I'm just missing? I'm
really puzzled. Any advice would be appreciated. Here's the traceback:

!--
Traceback (innermost last):
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/Publish.py, line 222, in
publish_module
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /var/lib/zope/2.2.2/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/Publish.py, line 171, in
publish
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/mapply.py, line 160, in
mapply
(Object: entry_addProcessor)
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/Publish.py, line 112, in
call_object
(Object: entry_addProcessor)
  File /var/lib/zope/2.2.2/lib/python/OFS/DTMLMethod.py, line 172, in
__call__
(Object: entry_addProcessor)
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_String.py, line
528, in __call__
(Object: entry_addProcessor)
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_With.py, line 146,
in render
(Object: manage_addProduct['JobBoard'])
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_Util.py, line 337,
in eval
(Object: job_board_entry_add(_.None,_, NoRedir=1))
(Info: _)
  File string, line 0, in ?
  File /var/lib/zope/2.2.2/lib/python/OFS/DTMLMethod.py, line 168, in
__call__
(Object: job_board_entry_add)
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_String.py, line
528, in __call__
(Object: job_board_entry_add)
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_With.py, line 146,
in render
(Object: job_board_entry.createInObjectManager(REQUEST['jobID'],
REQUEST))
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_Util.py, line 337,
in eval
(Object: propertysheets.entry_info.manage_editProperties(REQUEST))
(Info: REQUEST)
  File string, line 0, in ?
  File /var/lib/zope/2.2.2/lib/python/OFS/PropertySheets.py, line 458, in
manage_editProperties
(Object: Traversable)
  File /var/lib/zope/2.2.2/lib/python/OFS/PropertySheets.py, line 285, in
_updateProperty
(Object: Traversable)
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/Converters.py, line 173, in
field2date
  File /var/lib/zope/2.2.2/lib/python/DateTime/DateTime.py, line 698, in
__init__
Invalid Date-Time String: (see above)

--

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] Allright, who broke acquisition?

2000-10-01 Thread Timothy Wilson

Hi everyone,

I'm running Zope 2.2.2 on Linux. All of the sudden I've got some DTML
methods that are no longer being acquired in subfolders. I changed the HTML
a bit and the whole thing stopped working! I've got some little navigation
menus that I'd like to reuse in subfolders by simply referring to them via
dtml-var foo and having them acquired from the parent folder. Anybody know
when this is happening? Here's a sample of the code and the traceback:

table width="100%" border=0 cellpadding=1 cellspacing=0 bgcolor="#00"
 tr
  td width="100%"
   table width="100%" border=0 cellpadding=2 cellspacing=0
bgcolor="#FF"
tr
 td width="100%"
  font face="Verdana, Arial, Helvetica,
sans-serif" color="004A6D" size=2
  font color="#EE"Quick Links/font
 /td
/tr
   /table
  /td
 /tr
 tr
  td width="*"
   table width="100%" border=0 cellpadding=2 cellspacing=0
bgcolor="#EFEFEF"
tr
 tdfont face="Verdana, Arial, Helvetica, sans-serif" size="2"
  dtml-var lidisca href="/Navigation/"Site map/abr
  dtml-var lidisca href="/distinfo"District Information/abr
  dtml-var lidisca href="/feedback"Site feedback/abr
  dtml-var lidisca
href="http://mail.isd197.k12.mn.us/servlet/webacc"E-Mail System/abr
  dtml-var lidisca href="/about"About our site/abr
  dtml-if "AUTHENTICATED_USER.has_permission('Edit', this())"
   dtml-var lidisca href="/web-devel/"Web-devel Page/a
  /dtml-ifbr
 /td
/tr
   /table
  /td
 /tr
/table

!--
Traceback (innermost last):
  File /var/lib/2.2.0/lib/python/ZPublisher/Publish.py, line 222, in
publish_module
  File /var/lib/2.2.0/lib/python/ZPublisher/Publish.py, line 187, in publish
  File /var/lib/2.2.0/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
  File /var/lib/2.2.0/lib/python/ZPublisher/Publish.py, line 171, in publish
  File /var/lib/2.2.0/lib/python/ZPublisher/mapply.py, line 160, in mapply
(Object: local_links)
  File /var/lib/2.2.0/lib/python/ZPublisher/Publish.py, line 112, in
call_object
(Object: local_links)
  File /var/lib/zope/2.2.0/lib/python/OFS/DTMLDocument.py, line 177, in
__call__
(Object: local_links)
  File /var/lib/zope/2.2.0/lib/python/DocumentTemplate/DT_String.py, line
528, in __call__
(Object: local_links)
AttributeError: (see above)

--

Any ideas?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] handling date properties in dtml-if

2000-09-30 Thread Timothy Wilson

Hi everyone,

I've created a simple ZClass to allow our Human Resources dept. to post job
openings on our Web site. There's a DTML method that iterates through a
folder containing all of the 'Job Board Entry' instances and displays them
in an HTML table. No problem there.

The ZClass has a number of properties including two dates, 'date_posted' for
the date that the job is officially available and 'offer_expires' for the
date the job opening officially closes. I want to display only those jobs
for which the current date is on or after the 'date_posted' and on or
before 'offer_expires'. I've tried a bunch of things, but haven't hit upon
the winning answer. Any takers?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] uploading Word files to Zope

2000-09-13 Thread Timothy Wilson

Hey everyone,

Does anyone have any experience with allowing users to upload MS Word files
to your Zope server and make them available through your site. Specifically
I'm wondering about using wv (formerly mswordview) to convert the Word file
to HTML (and a DTML Document, I suppose) and publish that. Any comments?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] ZClass for PDFs

2000-09-07 Thread Timothy Wilson

Hi everyone,

I'd like to make a large number of PDF files available for download from my
site. HTML versions of the files will also be available for online viewing.

I could certainly include the PDF files as regular file objects or I could
create a ZClass specifically for PDF files.

I suspect that this question may be of general interest, so I'm asking for
comments about the pros and cons of either approach.

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] ZClass for PDFs

2000-09-07 Thread Timothy Wilson

On Thu, 7 Sep 2000, Tim Cook wrote:

 Timothy Wilson wrote:
  
  I'd like to make a large number of PDF files available for download from my
  site. HTML versions of the files will also be available for online viewing.
  
  I could certainly include the PDF files as regular file objects or I could
  create a ZClass specifically for PDF files.
  
  I suspect that this question may be of general interest, so I'm asking for
  comments about the pros and cons of either approach.
  
 
 Does this not do what you want?
 
 http://www.zope.org/Members/gaaros/ZpdfDocument

Thanks for the pointer.

It doesn't appear that the ZpdfDocuments is what I'm looking for.
ZpdfDocument seems to render PDF on the fly from structured text or HTML. I
was interested in simply storing an existing PDF file in the ZODB and making
it available for download.

Is there a reason to make a PDF ZClass? Would it make things easier?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] ftp permisions problem

2000-08-26 Thread Timothy Wilson

On Sat, 26 Aug 2000 [EMAIL PROTECTED] wrote:

 I am running zope ftp on 8021 by defualt.
 
 I ftp to it and attempt to upload a file into zope. I get a ettempt to create 
 file failed.
 
 Any ideas.
 
 I am running all zope permissions as defualt. I log in as superuser.

If you're running a 2.2.x version of Zope, then the new security model
doesn't allow superuser to own anything. Try creating a file as another
user.

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] FSSession problems...

2000-08-25 Thread Timothy Wilson

On Fri, 25 Aug 2000, Curtis Maloney wrote:

 Today, however, I find out that some mistakes have been happening.  People 
 are finding themselves logged in when they haven't yet, and others finding 
 they're logged in as someone else.  This is, obivously, a problem.

Warning! Shot in the dark ahead. :-)

Is it possible that your visitors who are experiencing this problem are
sitting behind a proxy that is improperly caching their cookies. I've seen
something like this where you could log in to zope.org, go to a different
machine and find that you were logged in there too.

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] Zope + DocBook HTML

2000-07-12 Thread Timothy Wilson

Hi everyone,

I've been doing some work with DocBook lately, and I'd like to convert my
work to HTML using the DSSSL stylesheet and put it online. Has anyone done
that? I'd be interested to hear about any strategies or pitfalls. 

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] queries and tiny tables and python methods... oh my!

2000-06-30 Thread Timothy Wilson

On Fri, 30 Jun 2000, Rik Hoekstra wrote:

  The problem is hooking them all together. Passing the query to a
  PythonMethod is throwing up the following error:
  
  Error Type: TypeError
  Error Value: argument l: expected read-only character buffer, instance found
 
 The error means you're trying to split up a string, but the argument is
 no string, but an instance (a Python Object). In many cases this is
 caused by an omission of parenthesis, like so 
 
 called_object instead of called_object()

OK, that makes sense.

 in which case the object is referenced instead of called and nothing is
 returned (of course). I did not find the culprit in your description,
 though. 

 I do not quite get what part you want to parse. Is it 'SB_B208'?
 accessing this in python is a bit strange due to the returned value. You
 get to the 'SB_B208'part in the following way:
 
 whateverreturnstheresult(someargument)[0][0][0], meaning (in this
 case):

I was trying to walk the fine line between providing too much detail and not
enough. Briefly, 'SB_B208' is an example of the type of string I'm trying to
parse. I do a string.split('l', '_') (where 'l' is the argument to the
string-splitting Python method) and get ['SB', 'B208']. 'SB' is one of the
two-letter codes that gets lookup up in the Tiny Table and 'B208' is an
office number. Together, these two strings represent a person's location in
our LDAP directory.

I don't understand where the weird tuple in the traceback is coming from.

  Here's the code for parseLocation ('l' is the argument):
  
  x = string.split(l, '_')
  return x[0]
 
 I may be reading badly, but can you explain what the l is (or is
 supposed to be)? Is it the tuple in the traceback?

'l' is passed to the Pyton Method. Examples would be: FH_123, SB_A231,
DO_111, etc.

  (BTW, changing it to x = string.split(`l`, '_') eliminates the error, but
  nothing is rendered.
  
  qry_person is an ZLDAP filter method that takes one argument (uid). The
  original dtml to display this mess looks like:
  
  dtml-call "REQUEST.set('user_id', user_id)"
  dtml-in "qry_person(uid = user_id)"br
dtml-in "buildingCodes(parseLocation(l))"
  dtml-var buildingbr  # 'building' comes from the Tiny Table
/dtml-in
  /dtml-in

Anyone see where the problem lies?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/



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




[Zope] queries and tiny tables and python methods... oh my!

2000-06-29 Thread Timothy Wilson

Hi everyone,

(Please excuse the vague Wizard of Oz reference in the sub., but my brain
may be imploding. :-)

I'm trying to merge several type of Zope objects, and I'm getting lots of
little errors. I wonder if someone could suggest where my problem lies.

1. I'm querying our LDAP server to retrieve the records for a given person
in the directory. No problem there.

2. I'm parsing one of the entries in the LDAP directory to retrieve the
user's location. Python method code is simple.

3. I'm using a Tiny Table to look up a value for one of the parsed strings.
Easy.

The problem is hooking them all together. Passing the query to a
PythonMethod is throwing up the following error:

Error Type: TypeError
Error Value: argument l: expected read-only character buffer, instance found

(BTW, Netscape on Windows doesn't product a traceback, but Netscape on Linux
does.)

!--
Traceback (innermost last):
  File /usr/local/src/zope/2.1.6/lib/python/ZPublisher/Publish.py, line 214,
in publish_module
  File /usr/local/src/zope/2.1.6/lib/python/ZPublisher/Publish.py, line 179,
in publish
  File /usr/local/src/zope/2.1.6/lib/python/Zope/__init__.py, line 202, in
zpublisher_exception_hook
(Object: ElementWithAttributes)
  File /usr/local/src/zope/2.1.6/lib/python/ZPublisher/Publish.py, line 165,
in publish
  File /usr/local/src/zope/2.1.6/lib/python/ZPublisher/mapply.py, line 160,
in mapply
(Object: rpt_contactInfo)
  File /usr/local/src/zope/2.1.6/lib/python/ZPublisher/Publish.py, line 102,
in call_object
(Object: rpt_contactInfo)
  File /usr/local/src/zope/2.1.6/lib/python/OFS/DTMLMethod.py, line 150, in
__call__
(Object: rpt_contactInfo)
  File /usr/local/src/zope/2.1.6/lib/python/DocumentTemplate/DT_String.py,
line 502, in __call__
(Object: rpt_contactInfo)
  File /usr/local/src/zope/2.1.6/lib/python/DocumentTemplate/DT_In.py, line
691, in renderwob
(Object: qry_person(uid = user_id))
  File /usr/local/src/zope/2.1.6/lib/python/DocumentTemplate/DT_In.py, line
633, in renderwob
(Object: buildingCodes(parseLocation(l)))
  File /usr/local/src/zope/2.1.6/lib/python/DocumentTemplate/DT_Util.py,
line 335, in eval
(Object: buildingCodes(parseLocation(l)))
(Info: parseLocation)
  File string, line 0, in ?
  File
/usr/local/src/zope/Zope/lib/python/Products/PythonMethod/PythonMethod.py,
line 168, in __call__
(Object: parseLocation)
(Info: ((['SB_B208'],), {}, None))
  File string, line 2, in parseLocation
TypeError: (see above)

--

parseLocation is a Python Method which takes 1 argument (a string) and 
returns the first element of the list that's formed by splitting the string.
That first element is a two-letter code that's looked up in a Tiny Table
called buildingCodes which returns the full name of the building.

OK, it looks to my relatively inexperienced eyes that the Python Method
isn't getting an argument of the type is expects.

Here's the code for parseLocation ('l' is the argument):

x = string.split(l, '_')
return x[0]

(BTW, changing it to x = string.split(`l`, '_') eliminates the error, but
nothing is rendered.

qry_person is an ZLDAP filter method that takes one argument (uid). The
original dtml to display this mess looks like:

dtml-call "REQUEST.set('user_id', user_id)"
dtml-in "qry_person(uid = user_id)"br
  dtml-in "buildingCodes(parseLocation(l))"
dtml-var buildingbr  # 'building' comes from the Tiny Table
  /dtml-in
/dtml-in

I'd appreciate it if anyone has any ideas about this. I'm probably making
the whole thing too complicated, but for reasons of code reuse, this seemed
like the most efficient approach.

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/




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




[Zope] parsing strings in DTML

2000-06-26 Thread Timothy Wilson

Hi everyone,

I'm working on what should be a simple problem.

I pulling an address out of an ldap query and the data is in the form of a
$-separated string. Example:

101 Main St.$Anytown$MN$12345

Please correct me if I'm wrong, but I could probably do dtml-call
"REQUEST.set('parsed_address', _.string.join(old_address, '$')" except for
the fact that getting "old_address" (the $-separated one) would require its
own dtml-var old_address statement. I can't nest dtmls so how to I
combine these?

Second question... Once I've got my string parsed into a list called
"parsed_string", what's the syntax for accessing certain elements of the
list?

Thanks.

-Tim

P.S. Maybe I should do this in an external or python method, but I thought
it would be overkill for a single operation like this. Am I wrong?

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] parsing strings in DTML

2000-06-26 Thread Timothy Wilson

On Mon, 26 Jun 2000, Rik Hoekstra wrote:

 Please correct me if I'm wrong, but I could probably do dtml-call
 "REQUEST.set('parsed_address', _.string.join(old_address, '$')" except for
 the fact that getting "old_address" (the $-separated one) would require its
 own dtml-var old_address statement. I can't nest dtmls so how to I
 combine these?
 
 I'm not sure I get you right.
 try something like (untested):
 
 dtml-call "REQUEST.set('parse_address', _string.split(old_address, '$')"

You're right, of course, about the "split." A slip of the typing fingers.
:-)

 If you want to know more, you should probably look at the Python docs, as
 this is Python stuff.

Doing this in Python is easy. That's not the problem. I've been struggling
with all of the RESPONSE.set, REQUEST.set, etc. stuff. I can't keep it all
straight. Adding the dtml layer to this really adds to the comlexity of it
all. I just need more Zen. :-)

Thanks for the help.

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] parsing strings in DTML

2000-06-26 Thread Timothy Wilson

On Mon, 26 Jun 2000, Rik Hoekstra wrote:

 try something like (untested):
 
 dtml-call "REQUEST.set('parse_address', _string.split(old_address, '$')"
 
 for parsing the string

But what if "parse_address" comes from a SQL query? Like this:

dtml-in qry_contactInfo
  dtml-call "REQUEST.set(dtml-var parse_address, ... etc.

Don't I run into trouble with nested DTML here?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] Attn all Minnesota Zope fans

2000-06-12 Thread Timothy Wilson

Hi everyone,

I'd like to know if anyone else in the Twin Cities region of Minnesota is
using Zope. I've hooked up with a couple other people in the past few
months, and I'm wondering if there's a critical mass of people who would be
interested in a *very* informal Zope SIG. Please let me know (even if you
don't want to be involved in any sort of SIG).

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] Higher Education

2000-05-26 Thread Timothy Wilson

On Fri, 26 May 2000, Rik Hoekstra wrote:

 How many are still interested in this?
 
 I was among one of the first to be active in the zope-edu list and I am
 still interested and even working on a product for course maintenance. I
 even sent Shane an immature snapshot, but had to reimplement the product
 because of nesting ZClasses (sigh). Moreover, I was changing jobs as well,
 which did not exactly help in getting things from the ground.
 
 So - yes I'm still interested Shane.

I'm still very much interested in this. School's out in a week or so, and I
plan to work hard this summer worked on developing Zope stuff to be used
here at school. I would love to renew the discussions.

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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