RE: [Zope-dev] DocumentLibrary 1.0b3 / Zope 2.4.2 (newbie?) problem

2001-11-02 Thread Paul Zwarts

Hi,

Are you using 

dtml-var ZopeTime().Date()

instead of 

dtml-var _.ZopeTime().Date()

ZopeTime I suspect doesn't come from the local namespace.

Cheers,
Paul Zwarts

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf
Of Kolb, Hap
Sent: Friday, November 02, 2001 11:26 AM
To: '[EMAIL PROTECTED]'
Subject: [Zope-dev] DocumentLibrary 1.0b3 / Zope 2.4.2 (newbie?) problem

Hi,

any attempt to submit a document to my newly created document library
under
zope 2.4.2 yields the following error (traceback appended below):

Error Type: NameError
Error Value: global name 'ZopeTime' is not defined

Now that's an error so basic that I suspect that it's me who is doing
something wrong---if I only knew what...!

Any help would be highly appreciated!

Best, ...hap


Traceback (innermost last):
  File /data1/software/Zope/zope-2.4.2/lib/python/ZPublisher/Publish.py,
line 223, in publish_module
  File /data1/software/Zope/zope-2.4.2/lib/python/ZPublisher/Publish.py,
line 187, in publish
  File /data1/software/Zope/zope-2.4.2/lib/python/Zope/__init__.py, line
226, in zpublisher_exception_hook
(Object: library)
  File /data1/software/Zope/zope-2.4.2/lib/python/ZPublisher/Publish.py,
line 171, in publish
  File /data1/software/Zope/zope-2.4.2/lib/python/ZPublisher/mapply.py,
line
160, in mapply
(Object: document_submit)
  File /data1/software/Zope/zope-2.4.2/lib/python/ZPublisher/Publish.py,
line 112, in call_object
(Object: document_submit)
  File /data1/software/Zope/zope-2.4.2/lib/python/OFS/DTMLMethod.py,
line
195, in __call__
(Object: document_submit)
  File
/data1/software/Zope/zope-2.4.2/lib/python/DocumentTemplate/DT_String.py
,
line 546, in __call__
(Object: document_submit)
  File
/data1/software/Zope/zope-2.4.2/lib/python/DocumentTemplate/DT_Try.py,
line
212, in render
  File
/data1/software/Zope/zope-2.4.2/lib/python/DocumentTemplate/DT_Try.py,
line
221, in render_try_except
  File
/data1/software/Zope/zope-2.4.2/lib/python/DocumentTemplate/DT_With.py,
line
148, in render
(Object: Documents)
  File
/data1/software/Zope/zope-2.4.2/lib/python/DocumentTemplate/DT_With.py,
line
133, in render
(Object: addDocumentFile(REQUEST))
  File
/data1/software/Zope/zope-2.4.2/lib/python/DocumentTemplate/DT_Util.py,
line
231, in eval
(Object: addDocumentFile(REQUEST))
(Info: REQUEST)
  File string, line 2, in f
  File
/data1/software/Zope/zope-2.4.2/Products/DocumentLibrary/DocumentStore.p
y,
line 355, in addDocumentFile
(Object: Documents)
  File /data1/software/Zope/zope-2.4.2/lib/python/OFS/ObjectManager.py,
line
324, in _setObject
(Object: Documents)
  File
/data1/software/Zope/zope-2.4.2/lib/python/Products/ZCatalog/CatalogAwar
enes
s.py, line 114, in manage_afterAdd
(Object: 1004694129.27)
  File
/data1/software/Zope/zope-2.4.2/lib/python/Products/ZCatalog/CatalogAwar
enes
s.py, line 184, in index_object
(Object: 1004694129.27)
  File
/data1/software/Zope/zope-2.4.2/Products/DocumentLibrary/CatalogPlus.py,
line 122, in catalog_object
  File
/data1/software/Zope/zope-2.4.2/lib/python/Products/ZCatalog/Catalog.py,
line 382, in catalogObject
  File
/data1/software/Zope/zope-2.4.2/lib/python/Products/ZCatalog/Catalog.py,
line 495, in recordify
  File /data1/software/Zope/zope-2.4.2/lib/python/OFS/DTMLMethod.py,
line
188, in __call__
(Object: date)
  File
/data1/software/Zope/zope-2.4.2/lib/python/DocumentTemplate/DT_String.py
,
line 546, in __call__
(Object: date)
  File
/data1/software/Zope/zope-2.4.2/lib/python/DocumentTemplate/DT_Util.py,
line
231, in eval
(Object: ZopeTime().Date())
(Info: ZopeTime)
  File string, line 2, in f
(Object: guarded_getattr)
NameError: (see above)

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


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



RE: [Zope-dev] ZSQL methods lookup vars in REQUEST only (why?)

2001-10-11 Thread Paul Zwarts

Hi Tim,

Just to play devil's advocate; It seems this way, that methods pulling
non-specifically from namespace could allow ways to modify the result if
someone paid close attention to whats going on... i.e The total price of
your shopping cart before its sent to the transaction broker. It
requires the programmer to keep even more close care that all variables
generated at runtime are first cleaned and wiped so that this same
REQUEST couldn't just be anticipated by someone who's interested.

Or can you suggest a way around this?

Thanks,
Paul Zwarts

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf
Of Tim McLaughlin
Sent: Thursday, October 11, 2001 1:30 PM
To: [EMAIL PROTECTED]
Cc: Micah Martin
Subject: [Zope-dev] ZSQL methods lookup vars in REQUEST only (why?)

I've been asked too many times now by developers what is wrong when they
call ZSQL Methods without passing parameters because their parameters
are in the namespace.  This seems to make sense to all new Zopers (and
some older ones like myself) because all other DTML lookups are in the
entire namespace.  

Anyway, I propose that ZSQLMethods change and do variable lookups in the
entire namespace, not just the REQUEST object.  It seems to be a simple
enough change (at least it looks it) and I can submit the patches, but
the harder thing is to get people to agree that it is a change for the
better.

The only argument that I have heard against it is that variables will be
found mysteriously through the stack and that this is harder to
understand.  However, that just makes it inconsistent with all other
DTML and therefore mysterious in its own way.  

Consistency is much better for learning and for remembering, and DTML in
ZSQL should work the same as DTML in DTML Methods, etc.  Please consider
this and abuse me as appropriate ;)

Regards,
Tim
-- 
Tim McLaughlin
iterationZERO - www.iterationzero.com
703.481.2233

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


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



RE: [Zope-dev] ZSQL methods lookup vars in REQUEST only (why?)

2001-10-11 Thread Paul Zwarts

I figured that I could be relatively safe by using heavy sessioning.
First I started with SQLSession, and now CST... 

Tips I do:

1) Create all formbased applications by folders. In otherwords
/folder/Support   is actually the folder and you always put the root
logic into index_html

2) The index_html is the control base, that will call in methods which
are your forms. (This way crawlers see a directory with only 1 page
(methods are hidden AFAIK)) I always split the application into a
minimum of 4 pieces (index_html, form, validation form, output). For
multi-stage forms like a shop, the number is sitting around 10. 

3) Split all forms OUT into theses methods, but DON'T put the form tags
in that method. Keep them in the index_html so you cannot go directly to
a single page other than index_html and be able to submit. It basically
fragments everything to be unuseable by itself.

4) I use CoreSessionTracking VERY heavily. Using a skin based concept,
every pageload executes a sessionlogic method, which does switching. For
instance, when any kind of form is submitted, I set a sessionvariable
called ACTION to a value like 'check'. Then the index_html is sensitive
to this change, and will process the form ONLY if the form was submitted
through the whole process properly. I also use this validation technique
to check forms and feedback incompletenesss. If youre carefull, the
session variables cannot be modified outside of the process flow so you
ensure nothing funky is going on.

5) For things like my shop, prices are always checked and modified in
the ZSQL method itself. In other words, I use dtml inside the ZSQL
method to enforce cascade SQL calls. Like when a customer requests the
price of a product and decides to buy it, the price is stored in hidden
fields on the html page, but  it doesn't make a differene, becausse at
runtime, the ZSQL ethod does a second redundant retrieve when adding the
record, so the price value ALWAYS is what it should be and cant be
changed by any hack (short mucking with the code)

Its totally obvious the pure python would be good instead, but I'm not
very good at it yet, and can crank out dmtl much faster. 

Just some tips if anyone's interested...

Paul Zwarts


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf
Of Toby Dickenson
Sent: Thursday, October 11, 2001 2:43 PM
To: [EMAIL PROTECTED]
Cc: Paul Zwarts; [EMAIL PROTECTED]
Subject: Re: [Zope-dev] ZSQL methods lookup vars in REQUEST only (why?)


 Anyway, I propose that ZSQLMethods change and do variable lookups in
the
 entire namespace, not just the REQUEST object.  It seems to be a
simple
 enough change (at least it looks it) and I can submit the patches,
but
 the harder thing is to get people to agree that it is a change for
the
 better.

Paul Zwarts wrote:

 Just to play devil's advocate; It seems this way, that methods
pulling
 non-specifically from namespace could allow ways to modify the result
if
 someone paid close attention to whats going on...

Exactly right.

Even the guys at Zope.com dont pay close enough attention...
Historically this has been the source of several security holes.

Tim wrote:

I agree.  However, this is true of all DTML.

That is true, and is the reason why dtml is inappropriate for any use
except trivial document templating. In other uses it is either buggy
(for the reason Paul mentioned) or very very ugly (because the author
knows about the potential bugs, and in dtml it is cumbersome to work
round them).

It is a pity that the current zope-newbie documentation presents dtml
as more than it is; as an essential part of the zope way. 

Anyway, there are plenty of alternatives to those non-trivial uses of
dtml; Python Scripts, python products, CMF skins, etc. None of them
are quite as slick, but at least they work.

I dont know of a good alternative to SQLMethods, so I would prefer
that they not be 'broken' in order to maintain consistency with a
feature that many people recommend you should avoid.


Tim also wrote:

The only argument that I have heard against it is that variables will
be
found mysteriously through the stack and that this is harder to
understand.  However, that just makes it inconsistent with all other
DTML and therefore mysterious in its own way.

You are right that the mechanism for calling SQLMethods from DTML is
different to calling DTML from DTML, but the odd one out is DTML
calling DTML!

DTML calling a SQLMethod current behaves the same as DTML calling
PythonScript, pure python functions, extension class functions,  or an
external method.


Toby Dickenson
[EMAIL PROTECTED]

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


___
Zope-Dev maillist

RE: [Zope-dev] Curiously Zope Hanging

2001-07-12 Thread Paul Zwarts

I've had this problem as well, although I changed from ZPopPy to
psycopg0.99.4 which solved the problem. What I found in REdhat Linux 7.1,
where the ps -ef command now queries more info from its children, I finally
saw the status of my dbms threads. The Zope hanging maybe wasnt zope
directly. It still translated requests BUT I saw in ps -ef:

postgresql db01 UPDATE waiting.

This is where the hang is. Several emails from Dieter just confused me more.
Something about Zope not having imlicit commits on transactions, so you had
to make sure a dtml-call transaction().commit() was placed somehwere. This
seemed to solve some problems at the time for me although I got alot of :

Warning: COMMIT, No transacion in progress


Hope I confused you a bit more. Maybe we can get somewhere eventaully ;_)

Paz



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf
Of Andre Schubert
Sent: Thursday, July 12, 2001 2:48 PM
To: [EMAIL PROTECTED]
Cc: zope
Subject: Re: [Zope-dev] Curiously Zope Hanging


Hi Steve,

Immunix Redhat 6.2
Zope 2.3.3
Postgres 7.1.2

I'am running Zope with -M -D and with Stupid_log_file. But i don't find a
problem.
When Zope hangs, then there is one Thread Running and if i trace this Thread
nothing
happens.

as

Steve Spicklemire schrieb:

 Hi Andre,

 What OS? I've had lots of trouble with Postgres and threads on
FreeBSD. Have
 you tried starting Zope with '-D' to see if threads are an issue?

 -steve

 Andre Schubert wrote:
 
  Hi all,
 
  I have a problem with my Zope, he hangs unexpectly if i view a special
  Method which generates Diagrams with data from a PostgresDB.
  The data are selected by a timespan( default is 24 Hours ).
  The Method works as descripted bellow:
 
  First when i call foo, then the HTML-Code is rendered with some
  images-tags, which are generated by selects.
  The image tags are calling the method foo which returns image data.
 
  If i want my diagrams from 2001-06-01 5:00 to 2001-06-01 12:05
  everything works fine.
  If i want my diagrams from 2001-06-01 5:00 to 2001-06-01 12:10 Zope
  hangs, no exception no log entry, Zope only hangs.
  If i want my diagrams from 2001-06-01 5:05 to 2001-06-01 12:10 which is
  the same timespan as example 1 Zope hangs too, no exception no log
  entry, Zope only hangs.
 
  If i view the postgres logs the nothing happens.
 
  Could anyone help me to find the problem or the place Zope is hanging
 
  thanks as
 
  P.S.: Exact the same problem occurs when i you another PostgresDA 
 
  ___
  Zope-Dev maillist  -  [EMAIL PROTECTED]
  http://lists.zope.org/mailman/listinfo/zope-dev
  **  No cross posts or HTML encoding!  **
  (Related lists -
   http://lists.zope.org/mailman/listinfo/zope-announce
   http://lists.zope.org/mailman/listinfo/zope )

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


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


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



RE: [Zope-dev] Curiously Zope Hanging

2001-07-12 Thread Paul Zwarts

Yes, thanks for mentioning that Frederico.

I _should_ have said thats what I used in PoPy. I dont use it anymore with
your product. : ), but that doesnt mean I'm any wiser for this. But *magic*
is a highly used term in programming these days, so I'm not worried too
much. At least I dont have unhappy customers anymore.

Paz

-Original Message-
From: Federico Di Gregorio [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 12, 2001 3:30 PM
To: Paul Zwarts
Cc: Andre Schubert; [EMAIL PROTECTED]; zope
Subject: RE: [Zope-dev] Curiously Zope Hanging


On 12 Jul 2001 15:20:16 +0200, Paul Zwarts wrote:
 I've had this problem as well, although I changed from ZPopPy to
 psycopg0.99.4 which solved the problem. What I found in REdhat Linux 7.1,
 where the ps -ef command now queries more info from its children, I
finally
 saw the status of my dbms threads. The Zope hanging maybe wasnt zope
 directly. It still translated requests BUT I saw in ps -ef:

 postgresql db01 UPDATE waiting.

 This is where the hang is. Several emails from Dieter just confused me
more.
 Something about Zope not having imlicit commits on transactions, so you
had
 to make sure a dtml-call transaction().commit() was placed somehwere.
This
 seemed to solve some problems at the time for me although I got alot of :

 Warning: COMMIT, No transacion in progress

never, never, never do that with psycopg. psycopg cooperates with zope
(that *does* commit on transactions) and has real transaction control.
with zope+psycopg you'll get a commit (or abort) just at the end of the
requested page.

ciao,
federico

--
Federico Di Gregorio
MIXAD LIVE Chief of Research  Technology  [EMAIL PROTECTED]
Debian GNU/Linux Developer  Italian Press Contact[EMAIL PROTECTED]
  All'inizio ho scritto un programma proprietario, in esclusiva per il
   cliente; e mi ha succhiato un pezzo di
   anima.   -- Alessandro Rubini



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



RE: [Zope-dev] Curiously Zope Hanging

2001-07-12 Thread Paul Zwarts

Ah, the common paradigm.

someone TOLD me that smoking cigarettes wiht ceral and milk will make me
barf, and I can assume that to be so. But when i do indeed barf, do I come
satisfied with that or now question if that it had to do with te spoon or
the bowl?

Paz

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf
Of Steve Spicklemire
Sent: Thursday, July 12, 2001 4:17 PM
To: Andre Schubert
Cc: zope
Subject: Re: [Zope-dev] Curiously Zope Hanging



Hi Andre,

Andre Schubert wrote:

 No, the problem is not reproduceable, because if move the timespan 5
minutes earlier then
 Zope crashes. And thats the problem.

Hmm.. my point was only that if you can *predict* correctly when Zope will
hang.. then it is at least 'reproducable'.

 If i call my diagrams in the order that a is the same and b is changing
everything works
 well and there are absolutely no hangs,
 but if i call my diagrams the other way that a is changing and b is the
same then Zope
 works if i select data from
 2001-06-01 5:00 to
 2001-06-20 12:05
 and Zope hangs if i select data from
 2001-06-01 5:00 to
 2001-06-20 12:10
 or from
 2001-06-01 5:05 to
 2001-06-20 12:10

 I hope you understand my explanations in my bad german-english.

I think I get the basic picture... but

 as

 Steve Spicklemire schrieb:

  Well, the good news is you have a reproducable symptom!
 

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


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



Re: [Zope] PCGI and MS-IIS on Nt5

2001-01-31 Thread Paul Zwarts


Hi there,

>For that the easiest solution is to put a redirect in your root to:
>http://localhost/scripts/zope.pcgi
either through a server setting or
>through an asp script with a "Response.Redirect('scripts/zope.pcgi')"
>You could also put your zope.pcgi in your root folder and make it a
default
>document (just like 'default.htm', 'index.asp' etc), but somehow I
guess
>that that will bring your troubles later on.
Thanks for the input... but it doesnt seem to work.
I get:
TD WIDTH="90%">
 H2>Zope Error/H2>
 P>Zope has encountered an error while publishing this resource.
 /P>
 P>STRONG>exceptions.ImportError/STRONG>/P>

 (class ZODB.POSException.StorageSystemError at 668838>,
'Could not lock the database file. There must be\012another process
that has opened the file.\012p>')
!--
Traceback (innermost last):
 File E:\!BRAIN~1\lib\python\ZPublisher\Publish.py, line 222,
in publish_module
 File E:\!BRAIN~1\lib\python\ZPublisher\Publish.py, line 130,
in publish
 File E:\!BRAIN~1\lib\python\ZPublisher\Publish.py, line 270,
in get_module_info
 File E:\!BRAIN~1\lib\python\Zope\__init__.py, line 110, in ?
 File E:\!BRAIN~1\lib\python\ZODB\FileStorage.py, line 262, in
__init__
 File E:\!BRAIN~1\lib\python\ZODB\lock_file.py, line 115, in
lock_file
ImportError: (see above)
For that matter, it seems the normal convention doesnt work anymore
of going through the pcgi file, so something has definatley gone wrong.
Should IIS be configured for the pcgi file to be a header or...?
I'll try the siteaccess, but i assume its in 2.3? how is it invoke if
it is a built in product?
Thanks again,
Paz
Max M wrote:
From: Paul Zwarts
>so, technically I did set it up correctly, but I want to configure
the
>default document so when I just put in:
>http://localhost
For that the easiest solution is to put a redirect in your root to:
http://localhost/scripts/zope.pcgi
either through a server setting or
through an asp script with a "Response.Redirect('scripts/zope.pcgi')"
You could also put your zope.pcgi in your root folder and make it a
default
document (just like 'default.htm', 'index.asp' etc), but somehow I
guess
that that will bring your troubles later on.
>I will get the root folder of my zopesite WITH the PCGI working. Now,
I
>need to use:
>http://localhost:8080
>If I goto http://localhost/scripts/zope.pcgi,
I get what I want with the
>PCGI, but I cannot use the site because the links do not work.
If you are not using Zope 2.3 You will probably want to use:
http://www.zope.org/Members/4am/SiteAccess2
It can change your links so that they will match the ugly /scripts/zope.pcgi
url that you get through IIS.
Regards Max M
___
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] PCGI and MS-IIS on Nt5

2001-01-29 Thread Paul Zwarts

Greetings all,

I've searched through Zopesite and a few docs on setting up Zope with
MS-IIS, but I cannot get PCGI to work

I followed BriaH's document and did everything. I CAN access
http://localhost:8080/scripts/zope.pcgi and get what I want to see in
dtml-var REQUEST...

so, technically I did set it up correctly, but I want to configure the
default document so when I just put in:

http://localhost

I will get the root folder of my zopesite WITH the PCGI working. Now, I
need to use:

http://localhost:8080

I get my website, but PCGI is not working, as I can see in dtml-var
REQUEST that it isnt connecting the PCGI. Without PCGI, my SQL Session
will not work.

If I goto http://localhost/scripts/zope.pcgi, I get what I want with the
PCGI, but I cannot use the site because the links do not work.

Can anyone explain what Im doing wrong?

TIA,
Paz




___
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] SQLSession not working

2001-01-24 Thread Paul Zwarts

Hi all,

I have a unix machine with PGSQL and Zope 2.2.1? and my app uses SQL
session brilliantly. But I've created another test machine with Zope
2.2.5, Win2kPro and MySQL 3.3.23 (i think)... and SQL Session no longer
works properly.

Every time I call a page, a different Session is used and Im not
maintaining any kind of session context... which basically destroys my
whole navigation system... Beyond that, I can put stuff into MySQL using
Zope, but nothing comes out... not even a simple SELECT * from TABLE
does nothing...

Can anyone make suggestions? Im using the ZMySQLDA product... 0.1.2

Cheers,
Paz


___
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] Opensource DBMS for WIN?

2001-01-23 Thread Paul Zwarts

Greetings,

Was wondering if there was an open source dbms to use with Zope on a
Win2k machine...? I found references of using cygwin to run PGSQL (which
we have on our unixbox) but would prefer something that doesnt run over
an extender-shell...

TIA,
Paz


___
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 a Session variable in a dtml-var

2001-01-22 Thread Paul Zwarts

Hi all,

Im trying to call a variable from SQLSession and then use it in a var.

I am using SQLSession to store the 'zone' value which I want to call in
the index_html document to then include a specific dtml-method depending
on the variable that the Session returns.

SESSION['zone'] will equal 'Home', so I want to:
dtml-var Home, where 'Home' is a dtml-method that contains html and
dtml that is specific to the page I want called.

so I've tried:
   dtml-var name="SESSION['zone']"
   dtml-var "PARENTS[-1].BC2.SESSION['zone']"

...But I cant seem to get it to work and I've spent hours searching the
zope site

I'm also trying to do the same thing with other methods that contain
interface html and all are name by
A_name
B_name called from SESSION['interface']

so I wanted to do something like:

   dtml-var name="'A_'+SESSION['interface']"

Which of course doesnt work either

Can anyone help?

Thanks very much in advance.
Paz


___
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] Transaction sizes

2000-11-16 Thread Paul Zwarts

Hi all,

I have a few forms that really work intermitently. They are quite large
in processing, accessing several thousand occurences in several tables,
several times. Wont go into details, but its a resource hog. Alot of
times the page eventually returns a No data error. This causes me to
wonder if there are some kind of restraints on Zope in terms of its job
size. Are there any tweaks to zope that I can fix this, or is it
directly related to the resources of the server?

Anyone with an idea?

TIA,

--
Paz
Oratrix Development BV
http://www.oratrix.com
GRiNS SMIL Editor
-



___
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] querying status in zsql

2000-11-10 Thread Paul Zwarts

Hi Zopers,

I have a processing script that takes emails and puts them into a table.
I bring up a table for confirmation and then submit the whole thing by a
iterative item:records zsql method.

My problem is that the table requires a unique primary key and quite
regularly there duplicates. So ofcourse it falls over with the expected
error. I have tried in the zsql method encapsulating the sql with a
dtml-if "checkforexistantrecord" and then at the bottom of the zsql
loop I commit so make sure the second time around, the data is checked.
This does not seem to work.

So what im left with wondering is, if I can query in the zsql method:
if error, then exit or go somewhere else

Is this possible? sorry to be very vague. The conundrum is the fact that
the zsql method it an item loop in its own, so i cannot seem to use an
if statement because it doesnt iterate by the normal dtml-in route

Any advice?

TIA,

--
Paz
Oratrix Development BV
http://www.oratrix.com
GRiNS SMIL Editor
-



___
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] querying status in zsql

2000-11-10 Thread Paul Zwarts

Thanks for that... Although Im not terribly sure what the magic behind the
sequence-start is, but it works very well.

Cheers,


--
Paz
Oratrix Development BV
http://www.oratrix.com
GRiNS SMIL Editor
-

Rik Hoekstra wrote:

 
  I have a processing script that takes emails and puts them into a table.
  I bring up a table for confirmation and then submit the whole thing by a
  iterative item:records zsql method.
 
  My problem is that the table requires a unique primary key and quite
  regularly there duplicates. So ofcourse it falls over with the expected
  error. I have tried in the zsql method encapsulating the sql with a
  dtml-if "checkforexistantrecord" and then at the bottom of the zsql
  loop I commit so make sure the second time around, the data is checked.
  This does not seem to work.
 
  So what im left with wondering is, if I can query in the zsql method:
  if error, then exit or go somewhere else
 
  Is this possible?

 yes, this is possible. If I understand your question at least. BTW This is
 untested, but I have used something similar before

 mailid is the input field/variable for your method

 dtml-in emailitems
dtml-in checkexistant_error(mailid=mailid) (if this is another zsql
 method)
 dtml-if sequence-start
skip or do something else
  dtml-else
 upload your email. You may want to call another Zsql method
 for this
  /dtml-if
 /dtml-in
 dtml-in

  sorry to be very vague. The conundrum is the fact that
  the zsql method it an item loop in its own, so i cannot seem to use an
  if statement because it doesnt iterate by the normal dtml-in route
 
  Any advice?

 hth

 Rik

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




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




Re: [Zope] dtml-if newbie question

2000-11-09 Thread Paul Zwarts

Another thing you can do, not sure if Im using it right, but the effect is
good...

   dtml-unless first_name
  dtml-raise type=ValidationError
font face="Arial, Helvetica, sans-serif" size="-1"
color="#00"bYou must specify a font color="red"First Name/b/font.

/font
  dtml-var tableSeparate
  dtml-var SupportCallForm
  /dtml-raise
   /dtml-unless

I have a support call form that is filed and submitted, and after the button
is pressed, a seperate validate method is called (can be in any document)
which will stop the processing if something isnt there and will show a red
error text at the top of the form that still contains the information.]

Its nice becuase the info stays there and doesnt take you off to a blank
screen with a few words.



--
Paz
Oratrix Development BV
http://www.oratrix.com
GRiNS SMIL Editor
-


Stephan Goeldi wrote:

 I want to select from a select menu, 3 amounts: 1000, 5000 or 1. After
 this, the form action method should reply:

 - "this is not much" if 1000 was selected,
 - "this is ok" if 5000 was selected,
 - "this is very much" if 1 was selected

 Now my form method looks like this:

 form action="form_action"
 How many money?
 select name="money"
 option1000
 option5000
 option1
 /select
 input type="submit" value="checkit"
 /form

 and the form_action method is this:

 dtml-in money
dtml-if "1000"
   This is not much!
/dtml-if
dtml-if "5000"
   This is ok!
/dtml-if
dtml-if "1"
   This is very much!
/dtml-if
 /dtml-in

 I am sure that there is an error in my thinking of these tags.

 TIA
 -goe-

 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

 Share information about yourself, create your own public profile at
 http://profiles.msn.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 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] MailHost: bcc broken ?

2000-10-24 Thread Paul Zwarts

Hi,

Im using this:

dtml-sendmail smtphost="mail.host" port="25"
To: dtml-var email
From: dtml-var emailfrom
Subject: dtml-var subject

Hi,

blah blah

/dtml-sendmail


Im supposing that the double brackets is due to the fact that the email address
itself is encapsulated with brackets as well as the variable being passsed.

Cheers,

--
Paz
Oratrix Development BV
http://www.oratrix.com
GRiNS SMIL Editor
-



___
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] Upgrade from 201 to 222

2000-10-17 Thread Paul Zwarts

Hi all,

I have installations of Zope, one for development and one for our live
system. We had run Zope 201 on both machines for quite some time, and
have just migrated the devshop to the latest Zope build 222.

I have noticed that the import/export mechanisms work and I can import
across both verisons, but before I was able to export an entire folder
and then import it. Now from old to new, I get an error

Error Type: TypeError
Error Value: ('len() of unsized object', , None)

What does this mean? I can still import single objects, but it is a
major pain to import one by one, as there so many. Using an XML type
doesnt work either because you cannot seem to apply that to a folder of
objects either.

Does anyone know about any issues that deal with this problem or am I
missing something?

Cheers and TIA,

--
Paz
Oratrix Development BV
http://www.oratrix.com
GRiNS SMIL Editor
-



___
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] ZSQL question

2000-10-17 Thread Paul Zwarts

 I have a table with lots of data in my Gadfly database. I would like to add
 a couple of new columns to that table. Is it at all possible to add columns
 to existing table or do I have to create a new table all together?


Nope,

ALTER  TABLE TABLE_NAME ADD COLUMN_NAME FORMAT_TYPE
i think should do it... Let me check

ALTER TABLE memberlist ADD name VARCHAR

Yep... that does it. Although I had tested this in PGSQL, Im sure it works for
GadFly also.

Since you are also inserting a new column you may want to initialize all
current reocrds with a value, but I cant remember what it was... If you really
need it, let me know, I'll dig in for you.

Cheers,

--
Paz
Oratrix Development BV
http://www.oratrix.com
GRiNS SMIL Editor
-



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




Re: [Zope] dtml-if and dtml-var question

2000-10-13 Thread Paul Zwarts

Hi there,

I've been having problems with DateTimes as well. My colleague and I (using Zope
201) found a problem with the module that causes any dbase timestamp to be rendered
to a non-standard UNIX time that has an annoying DST appended if in the Daylight
savings time zone, thus leaving the timestamp as useless when performing expressions
against it.

In our situation we used a scan from pos 0-29 to trap the proper timestamp syntax.
Then from there, I use an expression as follows:

   dtml-elif "list=='LI3'"
  dtml-call "REQUEST.set('timenow', (_.DateTime() - 30).Date())"
  dtml-in getMailLIC
 dtml-call "REQUEST.set('timethen',
_.DateTime(transaction_date[0:27]).Date())"
 dtml-if "timethen==timenow"
dtml-var buildMailList
 /dtml-if
  /dtml-in
   /dtml-if

This is just a small part of the code, and im sure there is a better way, but  hey,
it works.

Dont know if this helps you, but perhaps will give you an idea

Cheers,

--
Paz
Oratrix Development BV
http://www.oratrix.com
GRiNS SMIL Editor
-



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




[Zope] dtml-in loop to capture records

2000-10-12 Thread Paul Zwarts

Hi all,

I have a number of simple forms that retrieve all occurences of a table
into editable fields in a page. Each input tag is named:

table stuff
dtml-in getList
 ...
 input type="hidden" name="item.fieldname:records:required"
value="dtml-fieldname;"
 ...
/dtml-in
/table

Note, only the primary key field is actually a hidden type input and the
rest are text and so on.

In test of the submit button, the dtml-sql method called is structured:

dtml-in item
update table
set
field2=dtml-sqlvar field2 type=nb
where field1=dtml-sqlvar field1 type=nb
dtml-sql_delimiter;
/dtml-in

and the conditions of the method are item:records.

The intention is to submit in one go the entire list of occurences and
update anything that has changed. You can do this with checkboxes valued
on the primary key and other ways. The important thing is to leave
something that you use as the key in the WHERE statement.

Okay, this works fine, in MOST of my forms, but I have other forms where
this doesnt work at all and I get errors saying that the ITEM is a bad
request. I dont get it, what am I missing here that this works some
places and in other places with almost identical syntax, it falls over.

The form is correctly tagged, does the name attrib of the form tag have
to do with the dtml-in item... doesnt seem to be but tried it. Im
wondering if because the dtml-document is quite large with seperate
subloops and forms that publish in a sequence of events that this doesnt
work.

Hopefully someone has insight I'm missing here?

Cheers and thanks again,

--
Paz
Oratrix Development BV
http://www.oratrix.com
GRiNS SMIL Editor
-



___
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] [Fwd: Re: [Zope] dtml-in loop to capture records]

2000-10-12 Thread Paul Zwarts

Me again,

To further explain my dilemna, I just noticed that using the in ITEM
loop doesnt
seem to work if the dtml-call statement has an extra parameter. I had

dtml-call "verifyLog(mdate=mdate)"
publish..
dtml-in item
...
...
/dtml-in

Then use as in other working forms:

dtml-call verifyLog
publish..
dtml-in item
...
...
/dtml-in


Mdate is the primary key, again. This gave me the ITEM Bad Request
error.
Now, if I remove the mdate call, and remove the condition in the ZSQL
method, i can at least now get an error:

  File /var/Zope-201/lib/python/DocumentTemplate/DT_String.py, line 502,
in
__call__
(Object: string)
  File /var/Zope-201/lib/python/DocumentTemplate/DT_In.py, line 691, in
renderwob
(Object: item)
  File /var/Zope-201/lib/python/Shared/DC/ZRDB/sqlvar.py, line 168, in
render
(Object: vswitch)
Missing Input: (see above)

So, the item is rendering. The variable named item.vswitch is not... nor
is
mdate which had to be named as an item.mdate instead of being passed in
the
dtml-call statement as an argument.

In forms where this works, i simply call the method and the item renders
everything in properly. Now I can do none it seems. One other note is
that I
var in the form that the input item.fieldname parts are contained, so
the
calling method to render item is not the same document as the item
components.

Oi,

--
Paz
Oratrix Development BV
http://www.oratrix.com
GRiNS SMIL Editor
-

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




[Zope] REQUEST.set size

2000-10-10 Thread Paul Zwarts

Hi all,

I am new to Zope but worked for 2 years in a dev-env called Uniface so
Im fairly up to speed on Zope quickly. But I am having a problem writing
data through a REQUEST.set that is larger than its apparent limit.
(sorry can remember the exact error i get from Zope)

What I am trying to do is collect in a field a large list of emails that
are gathered in a dtml-in statement with a REQUEST.set('all', all +
email) nested in the loop. While appending the namespace to store the
data in PGSQL, i always get the size error which i assume is coming from
the publisher saying that a the request can only have a byte size of
1800 bytes or so.

Im not so hot with straight SQL because Uniface had its own methods, so
Im not sure if I can append data directly to a stored field or if I need
to continue trying to use the REQUEST.set. After the hundreth occurence
in the IN, the namespace I use to store the appended data, so I cannot
fully make a list of 2000 occurences. Any ideas?

Sorry, no code to show what Im doing but it should be pretty easy to
understand for all you veterans out there...

TIA,

--
Paz
Oratrix Development BV
http://www.oratrix.com
GRiNS SMIL Editor
-



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




Re: [Zope] REQUEST.set size

2000-10-10 Thread Paul Zwarts

Hi again,

Some extra info from reproducing the error again:

ValueError: PQsendQuery() -- query is too long.  Maximum length is 16382

This error comes from the traceback AFTER the method is called to store the
list in the dbms so I assume that the error is actually the DBMS field size
and NOT the request.set as I had imagined.

Then that leads to overflow tables... which I cant seem to create in PGSQL
as I know with Solid. Anyone have suggestions?

Cheers,
Paz

Paul Zwarts wrote:

 Hi all,

 I am new to Zope but worked for 2 years in a dev-env called Uniface so
 Im fairly up to speed on Zope quickly. But I am having a problem writing
 data through a REQUEST.set that is larger than its apparent limit.
 (sorry can remember the exact error i get from Zope)

 What I am trying to do is collect in a field a large list of emails that
 are gathered in a dtml-in statement with a REQUEST.set('all', all +
 email) nested in the loop. While appending the namespace to store the
 data in PGSQL, i always get the size error which i assume is coming from
 the publisher saying that a the request can only have a byte size of
 1800 bytes or so.

 Im not so hot with straight SQL because Uniface had its own methods, so
 Im not sure if I can append data directly to a stored field or if I need
 to continue trying to use the REQUEST.set. After the hundreth occurence
 in the IN, the namespace I use to store the appended data, so I cannot
 fully make a list of 2000 occurences. Any ideas?

 Sorry, no code to show what Im doing but it should be pretty easy to
 understand for all you veterans out there...

 TIA,

 --
 Paz
 Oratrix Development BV
 http://www.oratrix.com
 GRiNS SMIL Editor
 -

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

--
Paz
Oratrix Development BV
http://www.oratrix.com
GRiNS SMIL Editor
-



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