Re: [Zope] Problems with mysql and sql methode

2000-10-23 Thread Richard Moon

At 09:41 23/10/00, you wrote:
  MySQL is case-sensitive over table names, so MERCHANTPAYMENT is not the
  same as merchantpayment.

  Other databases (Postgresql, Informix) are not.

  Perhaps the Access/ODBC interface hides the case-sensitivity while the
  direct ZMySQLDA does not ?

Hmm, I'm not very clear about differences between handling of (table, 
column) names
in sql-databases, but postgres IS case sensitive (in some sense).

Well I'm confused !!!

I have two databases , one MySQL (3.23.25) one PostgreSQL (7.01), both with 
the same schema. Both have a table 'artist'. The following SQL Method (Zope 
2.2.1) works with both

select a.artist_id,a.known_name,a.initials
from artist a
where dtml-sqltest surname type=string

Change this to

select a.artist_id,a.known_name,a.initials
from ARTIST a
where dtml-sqltest surname type=string

it still works with PostgreSQL but with MySQL I get

"Table 'tunedb.ARTIST' doesn't exist"

Change this to

select a.artist_id,a.known_name,a.initials
from ARTIST a
where dtml-sqltest SURNAME type=string

Then it still works with PostgreSQL, provided you also change the argument 
to the SQL Method from surname to SURNAME.

When you click on the Test tab of an SQL Method it shows the SQL generated 
and you can see, in the above example, that the uppercase words are passed 
through unchanged to the database

viz.

select a.artist_id,a.known_name,a.initials from ARTIST a where SURNAME = 
'Molloy'

In what circumstances is PostgreSQL case-sensitive ?

Richard

Few days ago I wrote to messages to this list describing my problems
with postgres and capitals in column-names. The handling of these will
render dtml-sqltest .. useless, because it doesn't quote the name of the
vars. I that case postgres will not respect capital letter (will turn them
lowercase) but also won't find the column which name is written uppercase.

I think it would be usefull to collect the behaviour of different databases
and try to find a solution which will work with all of them.
The solution we have now clearly doesn't do that.

cheers,
oliver







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


Richard Moon
[EMAIL PROTECTED]



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




Re: [Zope] Problems with mysql and sql methode

2000-10-22 Thread Richard Moon

MySQL is case-sensitive over table names, so MERCHANTPAYMENT is not the 
same as merchantpayment.

Other databases (Postgresql, Informix) are not.

Perhaps the Access/ODBC interface hides the case-sensitivity while the 
direct ZMySQLDA does not ?

Richard

At 21:52 20/10/00, you wrote:
Ok know I get this problem
Error, _mysql.OperationalError: (1109, "Unknown table 'MERCHANTPAYMENT' in
where clause")


SQL used:

select PYNAME, PYPRICE
from PAYMENT
where MERCHANTPAYMENT.MEID = '418' and MERCHANTPAYMENT.PYID = PYID

other ideas?

Thanks

Jens Grewen

- Original Message -
From: "Farrell, Troy" [EMAIL PROTECTED]
To: "'Jens Grewen'" [EMAIL PROTECTED]; "Zope Maillist" [EMAIL PROTECTED]
Sent: Friday, October 20, 2000 10:04 PM
Subject: RE: [Zope] Problems with mysql and sql methode


  You may try:
 
  SELECT pyname, pyprice
  FROM payment
  WHERE merchantpayment.meid = 418 AND merchantpayment.pyid = payment.pyid
 
  I have a feeling mysql is not liking you for not selecting results from
  table MERCHANTPAYMENT becuase you said you would.
 
  Troy
 
  -Original Message-
  From: Jens Grewen [mailto:[EMAIL PROTECTED]]
  Sent: Friday, October 20, 2000 11:04 AM
  To: Zope Maillist
  Subject: [Zope] Problems with mysql and sql methode
 
 
  Hi,
 
  I have a problem with an SQL Methode with the this sql statement
 
  select PAYMENT.PYNAME, PAYMENT.PYPRICE
  from MERCHANTPAYMENT, PAYMENT
  where MERCHANTPAYMENT.MEID = 418 and MERCHANTPAYMENT.PYID = PAYMENT.PYID
 
  on the following tables:
 
 
  MERCHANTPAYMENT
  -
  MPID int(30)
  MEID int(30)
  PYID int(30)
  -
 
  PAYMENT
  -
  PYID int(30)
  PYNAME varchar(50)
  PYPRICE varchar(50)
  -
 
  the statement runs under MS ACCESS (link over myODBC) and I get the
correct
  resut but under zope sql methode I get no result. (There was no data
  matching)
 
  Any ideas
 
  Jens Grewen
 
 
  ___
  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 )


Richard Moon
[EMAIL PROTECTED]



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




Re: [Zope] MySQL and Zope struggles

2000-10-18 Thread Richard Moon

Thanks Monty,

I did try the temporary table route - problem is that Zope keeps the 
connection open so the temporary table stays there. Of course you can 
explicitly drop the temporary table after you've used it. However if the 
update fails for any reason the temporary table will still exist so next 
time in the SQL method fails because its trying to create a temporary table 
that is already there. I know this shouldn't happen etc but I don't like 
code that has that kind of potential problem in it - it isn't 'fail-safe'.

I decided better to use a permanent table. The SQL method locks it, deletes 
everything in it then writes the data it needs to store. That way its fail 
safe and I would expect more efficient than creating and dropping tables.

However I hadn't appreciate the REPLACE command. That's a real hidden gem. 
I'm off to see if I can use it - thanks.

Richard

At 11:37 17/10/00, you wrote:
You can do it with temporary tables.

Like this-

create temporary table foo (
   note_id int,
   notes varchar
);
insert into foo select Note.note_id, Note.notes from Note, Artist
   where Note.note_id=Artist.note_id and Artist.artist_id=23;
update foo set notes="asdlfna";
replace into Note select note_id, notes from foo;

This does assume that the note_id is unique.
You may also need to explicitly drop foo, because it goes away when you
disconnect, but of course  Zope holds connections open.

!!! However -- now that I think of it... you can just do:
replace into Note select note_id, "New Note" from Artist where artist_id=23;

Of couse, this will change all notes for an artist, so it assumes the
artist_id is unique as well. (Which I would assume it is from your model.)

If you need more complex things, look into temporary tables, but the MySQL
extension (like replace) do allow you to do fun things.

Hope this helps,
Monty

Richard Moon wrote:

  Nice idea. Trouble is the note table is used to hold notes for many
  different reasons, so it looks like this -
 
---   
  | Artist| | Recording  |  | Label  |   etc.
---   
  | artist_id | |recording_id|  |label_id|
  | note_id   | |note_id |  |note_id |
---   
|   ||  |   |
 -
  |
  --
 | Note |
  --
 | note_id  |
 | notes|
  --
 
  It looks as if there wasn't anything I was missing - I'm just going to have
  to break the code up into separate SQL Methods.
 
  The example I gave was quite simple compared to some of the updates I have
  to deal with.
 
  Thanks anyway.
 
  At 17:40 16/10/00, you wrote:
  Or you could renormalize your data to have:
  
- ---
  |  Artist |   |  Note |
  |-|---|---|
  |  id |   | id|
-| artist_id |
 | note_str  |
  ---
  
  you now have a list of notes by artist_id.
  You typically won't have a screen that doesn't have an Artist context
  to be adding a note to. (or to remove all notes from).
  Of course this means more work to migrate :-(
  And I don't know all possible scenarios for which you would
  need the structure you gave, but it is another way around this.
  It probably doesn't solve real complex scenarios either.
  
  JAT
  
  Dale
 
  Richard Moon
  [EMAIL PROTECTED]
 
  ___
  Zope maillist  -  [EMAIL PROTECTED]
  http://lists.zope.org/mailman/listinfo/zope
  **   No cross posts or HTML encoding!  **
  (Related lists -
   http://lists.zope.org/mailman/listinfo/zope-announce
   http://lists.zope.org/mailman/listinfo/zope-dev )


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


Richard Moon
[EMAIL PROTECTED]



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




[Zope] MySQL and Zope struggles

2000-10-16 Thread Richard Moon

I'm struggling to migrate an application from Zope/PostgreSQL to Zope MySQL 
(Why ? - because I've got a kind offer of free hosting if I use MySQL).

MySQL offers a limited set of features and is missing, among other things, 
the ability to use subqueries - so for example in PostgreSQL you can say

update note set notes =dtml-sqlvar notes type=string
 where note_id =
 (select note_id from artist where dtml-sqltest artist_id type=int)

and in MySQL you can't.

If you were working in a traditional programming environment you could 
overcome this by splitting the above into two parts - a select to retrieve 
the value of note_id from the artist table followed by an update of the 
note table using the returned value of note-id.

For example

select note-id into note-id-var from artist where artist-id = 23;
update note set notes = 'asdasda' where note-id = note-id-var;

The problem is that in Zope I believe you can't use a returned value within 
an SQL Method,  so the above code would fail. The only way I can see to do 
the above is to have two separate SQL Methods, one for the select, 
returning the note-id-var and another for the update. This is very clumsy.

I was wondering if anyone could tell me if there was a better way.

Many thanks


Richard

Richard Moon
[EMAIL PROTECTED]



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




[Zope] ZMySQLDA instal Import Error problem

2000-09-29 Thread Richard Moon

Installing MySQLDA-0.1.2 and running

python build.py

I get the error

Import Error: ./_mysqlmodule.so: undefined symbol: uncompress

Any clues ? I've just installed the latest (3.23.25) MySQL rpms on Linux 
6.1, including the client and development libraries, this seems to have put 
stuff in usr/lib and usr/lib/mysql so I made sure that these paths were in 
/etc/ld.so.conf and re-ran /sbin/ldconfig.

Here's the full output - thanks in advance.


rm -f *.o *~
rm -f *.a tags TAGS config.c Makefile.pre python sedscript
rm -f *.so *.sl so_locations
VERSION=`python -c "import sys; print sys.version[:3]"`; \
installdir=`python -c "import sys; print sys.prefix"`; \
exec_installdir=`python -c "import sys; print sys.exec_prefix"`; \
make -f ./Makefile.pre.in VPATH=. srcdir=. \
 VERSION=$VERSION \
 installdir=$installdir \
 exec_installdir=$exec_installdir \
 Makefile
make[1]: Entering directory `/opt/Zope-2.2.1/lib/python/Products/MySQLdb-0.1.2'
sed -n \
  -e '1s/.*/1i\\/p' \
  -e '2s%.*%# Generated automatically from Makefile.pre.in by sedscript.%p' \
  -e '/^VERSION=/s/^VERSION=[]*\(.*\)/s%@VERSION[@]%\1%/p' \
  -e '/^CC=/s/^CC=[  ]*\(.*\)/s%@CC[@]%\1%/p' \
  -e '/^CCC=/s/^CCC=[]*\(.*\)/s%#@SET_CCC[@]%CCC=\1%/p' \
  -e '/^LINKCC=/s/^LINKCC=[  ]*\(.*\)/s%@LINKCC[@]%\1%/p' \
  -e '/^OPT=/s/^OPT=[]*\(.*\)/s%@OPT[@]%\1%/p' \
  -e '/^LDFLAGS=/s/^LDFLAGS=[]*\(.*\)/s%@LDFLAGS[@]%\1%/p' \
  -e '/^LDLAST=/s/^LDLAST=[  ]*\(.*\)/s%@LDLAST[@]%\1%/p' \
  -e '/^DEFS=/s/^DEFS=[  ]*\(.*\)/s%@DEFS[@]%\1%/p' \
  -e '/^LIBS=/s/^LIBS=[  ]*\(.*\)/s%@LIBS[@]%\1%/p' \
  -e '/^LIBM=/s/^LIBM=[  ]*\(.*\)/s%@LIBM[@]%\1%/p' \
  -e '/^LIBC=/s/^LIBC=[  ]*\(.*\)/s%@LIBC[@]%\1%/p' \
  -e '/^RANLIB=/s/^RANLIB=[  ]*\(.*\)/s%@RANLIB[@]%\1%/p' \
  -e '/^MACHDEP=/s/^MACHDEP=[]*\(.*\)/s%@MACHDEP[@]%\1%/p' \
  -e '/^SO=/s/^SO=[  ]*\(.*\)/s%@SO[@]%\1%/p' \
  -e '/^LDSHARED=/s/^LDSHARED=[  ]*\(.*\)/s%@LDSHARED[@]%\1%/p' \
  -e '/^CCSHARED=/s/^CCSHARED=[  ]*\(.*\)/s%@CCSHARED[@]%\1%/p' \
  -e '/^SGI_ABI=/s/^SGI_ABI=[]*\(.*\)/s%@SGI_ABI[@]%\1%/p' \
  -e 
'/^LINKFORSHARED=/s/^LINKFORSHARED=[]*\(.*\)/s%@LINKFORSHARED[@]%\1%
/p' \
  -e '/^prefix=/s/^prefix=\(.*\)/s%^prefix=.*%prefix=\1%/p' \
  -e 
'/^exec_prefix=/s/^exec_prefix=\(.*\)/s%^exec_prefix=.*%exec_prefix=\1%/p' \

  /usr/lib/python1.5/config/Makefile sedscript
echo "/^#@SET_CCC@/d" sedscript
echo "/^installdir=/s%=.*%= /usr%" sedscript
echo "/^exec_installdir=/s%=.*%=/usr%" sedscript
echo "/^srcdir=/s%=.*%= .%" sedscript
echo "/^VPATH=/s%=.*%=  .%" sedscript
echo "/^LINKPATH=/s%=.*%=   %" sedscript
echo "/^BASELIB=/s%=.*%=%" sedscript
echo "/^BASESETUP=/s%=.*%=  %" sedscript
sed -f sedscript ./Makefile.pre.in Makefile.pre
/usr/lib/python1.5/config/makesetup \
  -m Makefile.pre -c /usr/lib/python1.5/config/config.c.in Setup 
-n  /usr
/lib/python1.5/config/Setup.thread /usr/lib/python1.5/config/Setup.local 
/usr/li
b/python1.5/config/Setup
make -f Makefile do-it-again
make[2]: Entering directory `/opt/Zope-2.2.1/lib/python/Products/MySQLdb-0.1.2'
/usr/lib/python1.5/config/makesetup \
  -m Makefile.pre -c /usr/lib/python1.5/config/config.c.in Setup 
-n  /usr
/lib/python1.5/config/Setup.thread /usr/lib/python1.5/config/Setup.local 
/usr/li
b/python1.5/config/Setup
make[2]: Leaving directory `/opt/Zope-2.2.1/lib/python/Products/MySQLdb-0.1.2'
make[1]: Leaving directory `/opt/Zope-2.2.1/lib/python/Products/MySQLdb-0.1.2'
gcc -fPIC  -I/usr/include/mysql -g -O2 -I/usr/include/python1.5 
-I/usr/include/p
ython1.5 -DHAVE_CONFIG_H -c ./_mysqlmodule.c
./_mysqlmodule.c: In function `_mysql_ConnectionObject_num_fields':
./_mysqlmodule.c:909: warning: passing arg 1 of `mysql_num_fields' from 
incompat
ible pointer type
gcc -shared  _mysqlmodule.o  -L/usr/lib/mysql -lmysqlclient -o _mysqlmodule.so
Traceback (innermost last):
   File "build.py", line 14, in ?
 import MySQLdb
   File "MySQLdb.py", line 19, in ?
 from _mysql import *
ImportError: ./_mysqlmodule.so: undefined symbol: uncompress

Thanks

Richard

Richard Moon
[EMAIL PROTECTED]



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




[Zope] How to give content maangers ability to update a Zope site ?

2000-09-14 Thread Richard Moon

How would you give a content manager the ability to update a live Zope site ?

What I have is an in-house development site with various folders and each 
folder has a manager.

I thought I would be able to let them use FTP on port 8021 to unload 
objects from the development site and update a live site on the 'net.

However it seems that FTP can only unload DTML documents and methods and 
can't unload SQL Methods, ACL User Folders or Database Connection Methods.

Plan B was to use the export facility but they would then need to have 
telnet access to the Zope import directory in order to put the .zexp file 
there, which seems a huge security gap to me.

Am I missing something obvious, how would you do it ?

Thanks



Richard Moon
[EMAIL PROTECTED]



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




Re: [Zope] Looking for Zope vs. Others at-a-glance comparison

2000-09-12 Thread Richard Moon

I've enjoyed the contributions on this thread. Some time back I mentioned 
that what hooked me on Zope was the Relational Database access "out of the 
box".

I liked the way Zope generated a simple database query form and result - so 
I agree strongly that Zope could hook more people if it did even more 
useful things without coding. I even suggested others submitted their 
favourite ideas for a "Wizards of Zope" beauty contest.

I've been supplying solutions to clients for xx years now and my philosophy 
has always been to code at the highest possible level. Don't code in 
machine code if you can code in assembler, don't code in assembler if you 
can code in C,  don't code in C if you can code in a 4GL, don't code at all 
if you don't have to :-)

Zope offers the potential to be the perfect development environment with 
tons of really good solutions off the shelf - these can be customised if 
they have to, we can drop down to Python if we really need to. Perfect.

Unfortunately its been difficult to get discussions like this going on 
zope.org as its mainly devoted to coding problems, while zope-dev is to do 
with deep and complex zopezen.

I know usability is high on Paul Everitts list, 'cos he said so in Paris.

Perhaps we need zope-usability.org as a forum for non-technical discussions 
about Zope development ?




___
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] The Wizards of Zope (was Linuxworld Article)

2000-07-17 Thread Richard Moon

At 19:34 17/07/00 +0900, you wrote:
as a newbie i am kind of glad that there are no slick interfaces. i want to
learn. i dont need to be coddled. :-)

Most of us do though !

The one thing that attracted me to Zope at the beginning was the ZSearch 
(using SQL Methods) Interface Wizard. Within an hour I was writing queries 
on my databases and doing useful stuff which I could show to people and say 
- look at this great Zope stuff !

I could also then look at the code and see how it worked, adapt it etc - so 
it was a great learning tool as well.

I think being able to do some simple but useful stuff when you first 
install a product is really, really encouraging and really helpful. There 
has to be substance behind the wizards, but with Zope there is.

The more Zope continues to become popular the more people who are not 
Python/OO gurus are going to look at it. And many of them are going to 
misunderstand it just like the Linuxworld article's author did.

If the Zope model is to convince people of its usefulness then it has show 
them what it can do. Otherwise people will dismiss it as 'theory', 'for 
gurus only', OO-only or whatever. Wizards are one way to do this which many 
(not all) would enjoy using.

Perhaps some us would like to think about the 'Wizards of Zope' and what we 
would like others to be able to achieve with Zope right out of the box.

Personally I'd like to see the ZSearch Interface build 'Intelligent' forms 
(that is DTML methods which render the form/results/error messages 
depending on the values returned by previous activities. )


Regards


Richard


Richard Moon
[EMAIL PROTECTED]



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




Re: [Zope] Q: Zope meeting in Paris in August?

2000-07-12 Thread Richard Moon

At 09:40 11/07/00 -0400, you wrote:

Hello everybody.  I'm chatting with someone in Paris about a possible
Zope gathering during my vacation to see my in-laws August 11th-25th.
I'll be in Paris for a few days in the beginning and possibly at the
end.  Is anybody interested in hosting an event?

Be great to meet you and other EuroZopers.


I'll be in Brittany the rest of the time, so if there's someone in
Rennes or Nantes, that's possible as well!

--Paul

Paul Everitt   Digital Creations
[EMAIL PROTECTED]  540.371.6909
-
The Open Source Zope application server
http://www.zope.org/
-

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


Richard Moon
[EMAIL PROTECTED]



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




Re: [Zope] GUF Problem

2000-07-12 Thread Richard Moon

I don't think GUF works in its current release, or maybe the set-up 
instructions are incomplete. I used it before and it was ok but I tried the 
latest release and had the same problem as you. I reported it to GUF's 
author but didn't get a reply.

I've reverted back to standard ACL folders for the moment.


Richard

At 12:04 08/07/00 -0300, you wrote:
Hi!

I'm trying the "HOWTO: GenericUserFolder Walkthrough" and, in the very
last step (trying to login as 'jorge'), every time I press the 'Ok'
button, I get the same login screen. Looking at the source of it, I see
the message:

!-- Traceback (innermost last): File
/usr/lib/python1.5/site-packages/ZPublisher/Publish.py, line 214, in
publish_module File
/usr/lib/python1.5/site-packages/ZPublisher/Publish.py, line 179, in
publish File /usr/share/zope/lib/python/Zope/__init__.py, line 202, in
zpublisher_exception_hook (Object: ElementWithAttributes) File
/usr/lib/python1.5/site-packages/ZPublisher/Publish.py, line 151, in
publish File
/usr/share/zope/lib/python/Products/SiteAccess/ChangeBehaviors.py, line
244, in traverse File
/usr/share/zope/lib/python/Products/GenericUserFolder/GenericUserFolder.py,
line 442, in guf_unauthorized (Object: ElementWithAttributes)
LoginRequired: (see above) --

What is wrong? I'm using Zope 2.1.6 (patched to that security problem),
on a Conectiva Linux box.

TIA
--
César A. K. Grossmann
[EMAIL PROTECTED]
http://members.xoom.com/ckant/

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


Richard Moon
[EMAIL PROTECTED]




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




Re: [Zope] GUF Problem

2000-07-10 Thread Richard Moon

At 17:15 10/07/00 +0200, you wrote:
Is it possible (and how) to use the standard ACL
with a user-database behind it ???

Thanks
Mario
Well kind of, in the sense that you can check the user login using ACL in 
the normal way and then you can match AUTHENTICATED_USER against your user 
database so your database knows who it is.

It means maintaining your users in two places (in the ACL folder and in the 
database), but it's a workaround until the GUF problems are ironed out or 
login manager is up and running (with docs on how to use it).

I need this because I've got users inputting data via Zope and I need to 
have a user ID I can stamp their data with - so all I do is -

select user_id
from users
where dtml-sqltest AUTHENTICATED_USER column=username type=string

in an SQL-method where AUTHENTICATED_USER is defined as an argument.

Seems to work OK !


that's what I'm doing until I (or someone else) finds out hot to get GUF 
working again.





 
  Richard Moon wrote:
  
   I don't think GUF works in its current release, or maybe the set-up
   instructions are incomplete. I used it before and it was ok but I 
 tried the
   latest release and had the same problem as you. I reported it to GUF's
   author but didn't get a reply.
 
  I just added a SQL user database, and will try to make it run.
 
   I've reverted back to standard ACL folders for the moment.
 
  My problem is the little window with "Zope" in it, when the user tries
  to logon. If there was a way to customize it to anything I want, I stay
  with the standart ACL. I'm using GUF only because of the docLogin
  methot, that allows me to customize the login page.
 
  []s
  --
  César A. K. Grossmann
  [EMAIL PROTECTED]
  http://members.xoom.com/ckant/
 
  ___
  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 )


Richard Moon
[EMAIL PROTECTED]



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




Re: [Zope] Authentication question.

2000-06-28 Thread Richard Moon

I don't know if my experience is any use. I'm developing a site with a 
postgresql backend and I want users to be able to enter data over the web, 
and I want to know who has entered what data. So only registered users can 
access the pages which allow data entry.

I set up a GUF (Generic User Folder) and used the How-to on using GUF with 
SQL. This checks the login and password against Postgress and of course I 
can then look-up the user-id whenever I want to 'stamp' data with that user-id.

I had some problems when testing the system using the 'super-user' since it 
wouldn't do sql-lookups for that user (this was Zope 2.1.4).

Unfortunately since installing the latest release of GUF I can't get it to 
work at all, except as super-user (not even in standard non-sql mode).

I'm waiting to see what happens in this area as I would hope that login 
manager or something coming out of the PTK would be the way to go.

Unfortunately Zope, and associated products seems to be in state of rapid 
change and there are quite a few unknowns at the moment.

If you'd like any details of my code just get back to me.

Regards

Richard


At 15:00 23/06/00 -0400, you wrote:
hi folks,

we are building an application that needs more information
for users than that which is made available via the
acl_users db (which can only contain username, password,
domains, and roles).  specifically, we have created an RDBS
database which tracks users via a numeric user id (and
speeds lookups), all tables are related via this integer
variable.

we are having difficulty, though, in that, zope continues to
want to build a new user entry only via acl_users.  has
anyone done something that will allow us to get around
this.  i have been searching all the various search engines
and zope list archives looking for something along these
lines, and i find a lot of stuff on how zope authentication
"out of the box" works though nothing on how to get the
authentication to work via another means.

i suspect it might require some editing of the base python
code, but i am hoping that this can be done from within the
Products directory and not in the preconpiled code.

any insights would be greatly appreciated.

thanks.

ciao!
greg.

Gregory Haley
venaca.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 )


Richard Moon
[EMAIL PROTECTED]



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




[Zope] Invalid Header (0) error

2000-06-23 Thread Richard Moon

Does anyone know what an Error Type: Value Error, Error Value:Invalid 
Header (0) error represents ?

It's interesting in the way it shows itself up. I added a dtml-var 
a_dtml_method to a dtml method and it generates this error. This dtml-var 
a_dtml_method is nested inside a dtml-if and would definitely not be 
rendered the first time the 'calling' dtml-method is rendered.

I took out the dtml-var a_dtml_method and I still got the same error.

I put a dtml-var REQUEST as the first line of the 'calling' method and 
everything then renders correctly with no error. Even the dtml-var 
a_dtml_method renders correctly when it should do so.

Any ideas, suggestions ?

I'm running Zope 2.1.6 on RedHat Linux

Thanks

Richard


Richard Moon
[EMAIL PROTECTED]



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




Re: [Zope] R: [Zope] Invalid Header (0) error

2000-06-23 Thread Richard Moon

Marcel, you're English is fine (better than my Italian).

I think you are near to the answer.

My dtml method 'dtml_main' has this kind of logic

dtml-if something
dtml-var a_dtml_method
dtml-else
 dtml-var another_dtml_method
/dtml-if

I had standard_html_header (which has an html header) in each of the 
'inner' methods, but not in the 'dtml_main' method. So I took 
standard_html_header out of 'a_dtml_method' and 'another_dtml_method' and 
put it in the 'dtml_main' method. No Invalid Header problems now. I don't 
know why that should make a difference but it seems to.

Thanks for your help

Richard


I found that the main dtml-method had no standard-header (so no html 
header) but the methods which it was rendering

At 15:01 23/06/00 +0200, you wrote:


  Does anyone know what an Error Type: Value Error, Error Value:Invalid
  Header (0) error represents ?
 
  It's interesting in the way it shows itself up. I added a dtml-var
  a_dtml_method to a dtml method and it generates this error. This 
 dtml-var
  a_dtml_method is nested inside a dtml-if and would definitely not be
  rendered the first time the 'calling' dtml-method is rendered.
 
  I took out the dtml-var a_dtml_method and I still got the same error.
 
  I put a dtml-var REQUEST as the first line of the 'calling' method and
  everything then renders correctly with no error. Even the dtml-var
  a_dtml_method renders correctly when it should do so.
 
  Any ideas, suggestions ?
 

This is very strange.
I had have the some problem.
I have seen that if the Zope generate a lot of empty lines at the begining
I receive this error.

the idea is to dont have too many empty lines at the begining of the output,
(I have no idea how many)

try to write something at the begining of the output doc.
I use someting like "Content-type:"

PM
PS: My English is not so good,
maybe you dont understood what I want to say



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


Richard Moon
[EMAIL PROTECTED]



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




[Zope] ZPyGreSQLDA broken problem

2000-06-12 Thread Richard Moon

I've just installed Zope 2.1.6 and PostgreSQL 7.02 and now I get a broken 
ZPyGreSQLDA with the following

Traceback (innermost last):
   File "/opt/Zope-2.1.6-linux2-x86/lib/python/OFS/Application.py", line 
387, in import_products
 product=__import__(pname, global_dict, global_dict, silly)
   File 
"/opt/Zope-2.1.6-linux2-x86/lib/python/Products/ZPyGreSQLDA/__init__.py", 
line 89, in ?
 import sys, os, Globals, DA
   File "/opt/Zope-2.1.6-linux2-x86/lib/python/Products/ZPyGreSQLDA/DA.py", 
line 91, in ?
 from db import DB
   File "/opt/Zope-2.1.6-linux2-x86/lib/python/Products/ZPyGreSQLDA/db.py", 
line 89, in ?
 import _pg, regex, sys, types
ImportError: No module named _pg

I can import _pg from the python command line.

I still have a Zope 2.1.4 installed and that works fine with PostgreSQL 
7.02, though I haven't tried re-installing it.

(Running on Linux 2.1 with PostgreSQL binary RPMs if thats any help).

Any clues as to the problem ?

Thanks


Richard


Richard Moon
[EMAIL PROTECTED]


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




Re: [Zope] Zope Pgsql 7.0/SQL Schema HeLp!

2000-05-22 Thread Richard Moon

Here is a ZSQL Method (called insert_author) which inserts into a 
PostgreSQL table which has a serial column called author_id.

Arguments

surname
search_name
initials
known_name
user_id
notes

Query Template
--
insert into author
(surname,search_name,initials,
known_name,user_id,notes)
values(
'dtml-var surname sql_quote',
'dtml-var search_name sql_quote',
'dtml-var "_.string.upper(initials)" sql_quote',
'dtml-var "_.string.capwords(known_name)" sql_quote',
'dtml-var user_id',
'dtml-var notes')
dtml-var sql_delimiter
select currval('author_author_id_seq')

Note that we don't insert anything into the serial column author_id since 
PostgreSQL puts that in for you.

Here is the schema for that table

CREATE TABLE author ( author_id serial, surname text, search_name text, 
initials text, known_name text, user_id int4, notes text

And here is a snippet from a dtml method which performs the insert and 
retrieves the value of author_id for the row just inserted.

dtml-in insert_author
   dtml-call expr="REQUEST.set('author_id',currval)"
/dtml-in
Author_id is dtml-var author_id

This assumes all the arguments to insert_author (that is surname, user_id 
etc) have already been set up from a form or in some other way.

HTH

Richard


At 23:22 20/05/00 -0400, you wrote:
This is going to be a long winded questions.

Ok I have been hacking around with Zope and Pgsql for awhile now.
I am trying to learn both at the same time, not any easy task, I don't
know SQL that well. I learn by doing ,and this is really fun, kinda like
a
digital puzzle of sorts. So any way I set up a database in pgsql to hold
contact information. This was no small task for me, like I said, I am
new to SQL.
I did discover a neat way to use CREATE VIEW foo AS SELECT that is not
in the book though. Anyway the PRIMARY KEY for the table of names is a
SERIAL type, all other tables such as phone numbers and addresses use
REFERENCES to this KEY. The database works quite well, I think I have it
normalize as much as need be (bare with me I am still learning). Now on
to Zope

I have Zope all set, and I can run all your standard SELECT, INSERT,
UPDATE stuff.
But I have one hitch,  I can't seem to figure out how to make it so an
end user
could add a name and email address without knowing about the PKEY
number. This is no problem for a DBA but I want to make it easy for
anyone to INSERT and UPDATE records. Did I make a bad design choice in
use unique numbers to glue all the tables together. Is this an interface
problem. Am I missing something. I need some help. Can someone point me
in the right direction please?

Richard

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



Richard Moon
[EMAIL PROTECTED]


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