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




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




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