[Zope] Dynamic ordering of DTML-IN?

2001-01-23 Thread Andy Gates

Another one from the "my brain don't work" side of the tracks:

I have a staff list that I want to be orderable by first or last name. 
So I have buttons for each that link thus:

a href="staff?orderby=firstname" etc

The idea is that that feeds over to the DTML-IN tag thus:

dtml-in "sql_search(search='foo')" sort=orderby

But this barfs, because it's expecting a field name "orderby" and there
isn't one.  How do I evaluate that?

--
Andy Gates, Learning and Research Technology
[EMAIL PROTECTED] - ICQ#74362415
http://www.ilrt.bristol.ac.uk


___
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] Dynamic ordering of DTML-IN?

2001-01-23 Thread Andy Gates

Message-ID: [EMAIL PROTECTED]
Priority: NORMAL
X-Mailer: Execmail for Win32 5.1 Build (9) 
MIME-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"

 You can use something like:
 
 dtml-if "orderby=='firstname'"
   dtml-in "sql_search(search='foo')" sort=firstname
 dtml-elif "orderby=='lastname'"
   dtml-in "sql_search(search='foo')" sort=lastname
 /dtml-if

Hmm, that chokes, becuase it thinks the /dtml-if tag is inside the 
dtml-in I think.

AndyG


___
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: Versions

2001-01-08 Thread Andy Gates

Message-ID: [EMAIL PROTECTED]
Priority: NORMAL
X-Mailer: Execmail for Win32 5.1 Build (9) 
MIME-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"

Thanks, folks.  That works a treat :)

AndyG

___
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] Searching static copy

2000-07-28 Thread Andy Gates

My current Zope site has most of its copy taken from databases.  But it
also has a number of static pages.  I need an all-in-one search that 
will go through all of the content.

Most of this is easy: search through the three databases in turn and 
present their results.  But how do I search through the contect of DTML
pages and methods?
--
Andy Gates, Learning and Research Technology
[EMAIL PROTECTED] - ICQ#74362415


___
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] Stability fun on NT

2000-07-20 Thread Andy Gates

So Zope choked last night, stopped responding (no serious load, only 
me tinkering with pages), and when I get to check the event log it's 
full of:

"The application, ./python.exe, generated an application error The error
occurred on  7/20/2000 @ 10:49:15.625 The exception generated was
c005 at address 1b040f64 (Ordinal101) "

If I stop and restart Zope, I get the same error; if I reboot the 
server I get a few pages successfully served before the error hits 
again.  Mucho annoying.

Has anyone had similar problems with Zope running on NT?
--
Andy Gates, Learning and Research Technology
[EMAIL PROTECTED] - ICQ#74362415


___
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] Stability fun on NT

2000-07-20 Thread Andy Gates

Message-ID: [EMAIL PROTECTED]
Priority: NORMAL
X-Mailer: Execmail for Win32 5.1 Build (9) 
MIME-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"

 How much disk space / RAM have you got?

1.8Gb free on the Zope drive, 256Mb RAM, dual PIII-500 processors.

 What size is data.fs?

4.5Mb - is that big?

 What else are you doing with the machine?

IIS running an intranet that gets moderate traffic - always busy but 
no really heavy load.  Also file serving. 

 What versions of what software (including Zope  WinNT) are you 
running?

NT4 SP6, Zope 2.

 Are you doing anything 'interesting' with the machine or stuff in Zope?

Not really.  I'm putting together a generic news interface that links to
an Access database to pull articles.  Lots of database calls and lots 
of DTML-IN but nothing particularly clever.  The machine doesn't do 
anything else exciting.

AndyG

___
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] Stability fun on NT

2000-07-20 Thread Andy Gates

Message-ID: [EMAIL PROTECTED]
Priority: NORMAL
X-Mailer: Execmail for Win32 5.1 Build (9) 
MIME-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"

...and now it's working again, for a while, and I haven't done 
anything.  Don't like this.

AndyG

___
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-killer: zSQL method that crashes Zope

2000-07-20 Thread Andy Gates

Here's a thing.  Those problems I was having with some sort of Zope-killing 
page have been tracked down to a particular zSQL method.

The zSQL method is duff, in that is should fail - the perils of late-night 
coding on decaf, I fear - but it should fail neatly with a Zope error, not 
crash out the Python interpreter and force some poor schmuck to restart the 
limping Zope process.  I don't know whether this is a peculiarity to my 
setup (NT4SP6, IIS4, Zope2, Access97 database) or a general problem; 
perhaps some of the developer-hatted Zopistas could take a look?

The poison SQL is this:

select (dtml-var field, field2)
from tablename
where (field1= dtml-sqlvar parameter1 type=string
   and dtml-var field  '')

Where two parameters are passed to the method, namely "field" and 
"parameter1".  parameter1 is fed in as a dtml-sqlvar and searches against 
the table's field1 column.  field is passed in as a dtml-var and is used to 
define which of the table's other fields is retruned.  field2 is always 
returned.

What makes the SQL duff is the parentheses around the fields in the first 
part of the SELECT.  They're not required and if you remove them to produce 
the zSQL below, it works fine.

select dtml-var field, field2
from tablename
where (field1= dtml-sqlvar parameter1 type=string
   and dtml-var field  '

So why does it kill Python?  I'm only vaguely concerned now that I've found 
the fault, because of course the SQL is canned and no developer could get 
their hands on it - but this experience redoubles my acceptance of the 
notion of canned SQL!

AndyG

"I don't suffer from stress.  I'm just a carrier."


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




Re: [Zope] Re:Web Site newbie

2000-07-07 Thread Andy Gates

Message-ID: [EMAIL PROTECTED]
Priority: NORMAL
X-Mailer: Execmail for Win32 5.1 Build (9) 
MIME-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"

 Most stuff 90% of sites do can be done in Zope and ZServer is great for
 that. To serve from ZServer I think files have to be in Zope (but I might be
 wrong on that)...

Well, files could also be in an ordinary structure and referred to 
using the External FileSystem product, which creates a link in the Zope
Object Database to a folder on your machine.  I use this for legacy 
compatibility - to access an old folder of images that I can't (yet) 
move over to Zope only.

AndyG

___
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: Date checking?

2000-07-07 Thread Andy Gates

Message-ID: [EMAIL PROTECTED]
Priority: NORMAL
X-Mailer: Execmail for Win32 5.1 Build (9) 
MIME-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"

 Is better to put some mor lines from Traceback Exception
 To see the modul and the line

Here it is:
Traceback (innermost last):
  File C:\PROGRA~1\WebSite\lib\python\ZPublisher\Publish.py, line 214, in 
publish_module
  File C:\PROGRA~1\WebSite\lib\python\ZPublisher\Publish.py, line 179, in publish
  File C:\PROGRA~1\WebSite\lib\python\Zope\__init__.py, line 202, in 
zpublisher_exception_hook
(Object: ElementWithAttributes)
  File C:\PROGRA~1\WebSite\lib\python\ZPublisher\Publish.py, line 165, in publish
  File C:\PROGRA~1\WebSite\lib\python\ZPublisher\mapply.py, line 160, in mapply
(Object: news_maintenance)
  File C:\PROGRA~1\WebSite\lib\python\ZPublisher\Publish.py, line 102, in call_object
(Object: news_maintenance)
  File C:\PROGRA~1\WebSite\lib\python\OFS\DTMLMethod.py, line 150, in __call__
(Object: news_maintenance)
  File C:\PROGRA~1\WebSite\lib\python\DocumentTemplate\DT_String.py, line 502, in 
__call__
(Object: news_maintenance)
  File C:\PROGRA~1\WebSite\lib\python\DocumentTemplate\DT_In.py, line 691, in renderwob
(Object: sql_news_search(story='%%'))
  File C:\PROGRA~1\WebSite\lib\python\DocumentTemplate\DT_Util.py, line 335, in eval
(Object: _.DateTime(startdate).isPast())
(Info: startdate)
  File lt;stringgt;, line 0, in ?
  File C:\PROGRA~1\WebSite\lib\python\DateTime\DateTime.py, line 545, in __init__
TypeError: (see above)

Any clues?

Andy

___
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: Date checking?

2000-07-06 Thread Andy Gates

A quicky for you Zopistas:  I have some dates in a database, which 
govern when a story becomes live and when it expires.  I need to do a 
test along the lines of:

dtml-in stories
  if (startdate is past) and (expirydate is future)
show the story
  /if
/in

I have seen the fmt parameters isPast and isFuture and this gives me a 
true/false response:  dtml-var startdate fmt=isPast  but how do I use
that in an if test?  I keep (as usual) getting syntax errors.  Help!

--
Andy Gates, Learning and Research Technology
[EMAIL PROTECTED] - ICQ#74362415


___
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] LONG insert 2000 chars fail

2000-07-06 Thread Andy Gates

Message-ID: [EMAIL PROTECTED]
Priority: NORMAL
X-Mailer: Execmail for Win32 5.1 Build (9) 
MIME-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"

Possibly related:  Webform-based news story editor generates long text 
strings for body text.  Using an ordinary form, this ends up 
(url-encoded) in the URL, but it's betting truncated after about 2000 
chars.  Many of my stories are longer than that.  What to do?

AndyG

___
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] R: [Zope] Newbie: Date checking?

2000-07-06 Thread Andy Gates

Message-ID: [EMAIL PROTECTED]
Priority: NORMAL
X-Mailer: Execmail for Win32 5.1 Build (9) 
MIME-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"

 dtml-if "_.DateTime(startdate).isPast() and _.DateTime(expirydate).isFuture()"
 ...
 /dtml-if

I'll work it out one day, honest.  Ta.

AndyG

___
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] R: [Zope] Newbie: Date checking?

2000-07-06 Thread Andy Gates

 dtml-if "_.DateTime(startdate).isPast() and 
_.DateTime(expirydate).isFuture()"
 ...
 ...
 /dtml-if

This gives:
Error Type: TypeError
Error Value: __div__ nor __rdiv__ defined for these operands

The dates are pulled from an access (!) database where they are defined
as date/time types.  Me confoosed.

Andy

___
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] FOR loops?

2000-06-30 Thread Andy Gates

This ought to be easy:

dtml-in through a list of entries.  Each entry has a string and a 
number which indicates its level of indentation, so "Root",0; "Main",1;
"Sub",2 and so on.

Presenting these in a SELECT input I want to show the indentation so 
it's easy to see and use.  Obvious answer is to use nbsp; characters 
to pad the values thus:

select
dtml-in sequence
  option value="whatever"
for loop=0 to entry-indent-value
  nbsp;
/for
entry-string-value
  /dtml-in
/select

So where does Zope hide its FOR loop?  Can't find the bugger anywhere!
--
Andy Gates, Learning and Research Technology
[EMAIL PROTECTED] - ICQ#74362415


___
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 method: Trying to be too clever?

2000-06-30 Thread Andy Gates

Is it possible to pass a variable into anything other than the values 
of a SQL method?  I'm trying to pass a parameter to a method, such that
the param is used to define which field is affected by the action:

insert into related (rootstory, dtml-sqlvar field)
values (dtml-sqlvar storytitle,
dtml-sqlvar value)

Possible?  This doesn't work, of course...
--
Andy Gates, Learning and Research Technology
[EMAIL PROTECTED] - ICQ#74362415


___
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] SQL method: Trying to be too clever?

2000-06-30 Thread Andy Gates

Message-ID: [EMAIL PROTECTED]
Priority: NORMAL
X-Mailer: Execmail for Win32 5.1 Build (9) 
MIME-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"

  in that case you just want a dtml-var field (you not passing it as sql
  query values)

Perfecto.  That's two today.  My turn to get the beers.

AndyG

___
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: String work

2000-06-27 Thread Andy Gates

Simple stuff from the simple people today: string manipulation.

I have a string variable which has various chunks delimited by double 
tildes ~~. In order to do what I need to do, I need to extract the 
section of the string after the last double-tilde, so that

"fred~~bloggs" returns "bloggs"
"fred" returns "fred"
"fred~~bloggs~aardvark" returns "aardvark"

I can see that rfind is the thing I need to use, but as usual (gah! 
newbie!) I'm stuck on the syntax.  Help!
--
Andy Gates, Learning and Research Technology
[EMAIL PROTECTED] - ICQ#74362415


___
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: Listing filesystem objects?

2000-06-13 Thread Andy Gates

NewbieQ of the moment:

So there's a folder on my server, call it \\server\files\logos.  I want
to list its contents in a drop-down listbox in a form; something like 

select name="logo_filename"
   option selected value="default.jpg"default.jpg
   option value="file1.jpg"file1.jpg
   ...
/select

Needless to say, I've installed the local filesystem product and 
created a localfs object called "logos" that maps to the correct 
folder.  And now I'm mired in the docs.  I'm thinking that I can just 
use dtml-in to iterate through the file ids of the objects in that 
folder, but I'm damned if I can see *how* to do that.  Any tips?

--
Andy Gates, Learning and Research Technology
[EMAIL PROTECTED] - ICQ#74362415


___
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] Two in one?

2000-06-02 Thread Andy Gates

Fun for all the family.  I'm trying to produce a page that draws from 
two databases following one friendly search.  The first chunk of data 
is from the search itself and returns, among others, an ID which I want
to pass into the second chunk to search it.  Kinda like this:

Search page: blah

Report page: loop thru hits on "blah" in db1, any of 6 fields (name, 
desc)
show id
show name
show desc...
loop thru hits in id db2
show users
show friendlynames
/loop
/loop

The problem I have is passing parameters to the db2 search.  Even if I 
set the SQL method to use a parameter with the same name as the var 
returned by the first search, I get a Zope error telling me I'm not 
passing enouh parameters to it.  Testing the methods independently they
work fine.

So, (as usual) what's the no-brain bozo error I'm making?  Is is 
possible to programmatically pass variables around like this (surely it
is,this would be trivial in ASP/JSP)?
--
Andy Gates, Learning and Research Technology
[EMAIL PROTECTED] - ICQ#74362415


___
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] Two in one?

2000-06-02 Thread Andy Gates

 dtml-in "secondQuery(id=id, name=name)"

Ahh... quotes.  Parentheses.  Works a treat.  Ta.

AndyG

___
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] Really dumb newbie question

2000-05-23 Thread Andy Gates

This one is so dumb you'll be laughing, but any help would be greatly 
appreciated.

I need to evaluate an IF.  That's all.  I have a variable called Action
that's a string, and it can be null, "Add", "Update" etc.

I try something along the lines of:
dtml-if action == "add"
blah
/dtml-if

and whatever I try, I get "Invalid attribute name, "action", for tag 
dtml-if Action=="add""

Assuming that I'm not just cursed by the Zope Gods, what am I doing 
wrong?

Yeesh, I feel dumb.
--
Andy Gates, Learning and Research Technology
[EMAIL PROTECTED] - ICQ#74362415


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