[Zope] Help needed with namespace

2000-09-26 Thread a . wacknitz

Hello all,

after updating to Zope-2.2.0 I have problems with ZSQL methods.
It seems as if the namespace of ZSQL methods has changed sind Zope-2.1.x.
I cannot access the AUTHENTICATED_USER object anymore - it is not known to
ZSQL methods:

gives an "Missing input variable, AUTHENTICATED_USER" error
and

gives "error type:  NameError
   error value: AUTHENTICATED_USER"

The security mechanism of my application heavily depends on this object!
What has happened to the ZSQL methods? I have already updated to Zope-2.2.2
but with no luck so far.

Any help is greatly appreciated,
Andreas
**
This email message has been swept by MIMEsweeper for the presence of
computer viruses.

Francotyp-Postalia AG & Co.


___
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-2.2.0: ZSQL problem

2000-09-25 Thread a . wacknitz

Hi all,

after upgrading from Zope-2.1.5 to Zope-2.2.0 (Windows) I have some problems
with ZSQL-methods:
 gives an error: Missing input variable,
AUTHENTICATED_USER

It used to work properly in 2.1.x. Is this already fixed in Zope-2.2.2 or is
there any
workaround for this?

Regards,
Andreas
**
This email message has been swept by MIMEsweeper for the presence of
computer viruses.

Francotyp-Postalia AG & Co.


___
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] ZODBCDA fails under 2.2

2000-08-03 Thread a . wacknitz

> I'm trying to access data via the ZODBCDA latest build and Zope 2.2 
> Whenever the ODBC query returns data, the user is challenged for
authentication. 
> Pages that do not use ODBC and database methods that return empty sets are
not challenged. 
>
> Has anyone else encountered this? 
Yes, I have the same problems with ZODBCDA and Zope-2.2. I still haven't
found out what
exactly causes this error.

>
> In my configuration, anonymous has acquired "Access", "View" and "use db
methods" rights. 
> I've also tried with explicit rights. 
It doesn't work for me as a manager either...

Andreas
**
This email message has been swept by MIMEsweeper for the presence of
computer viruses.

Francotyp-Postalia AG & Co.


___
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: Accessing ZSQL methods from Python

2000-06-09 Thread a . wacknitz



> -Original Message-
> From: Dieter Maurer [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 08, 2000 10:21 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [Zope] Q: Accessing ZSQL methods from Python
> 
> 
> [EMAIL PROTECTED] writes:
>  > my question is what type or value is returned by a ZSQL 
> method that is
>  > invoked from Python?
> ZSQL methods return "Shared.DC.ZRDB.Results.Results" instances.
> Such an instance essentially behaves like a sequence of
> objects each describing one result row.
> These objects have been set up such that a column value
> can be accessed as attribute with the column name.
> Thus, "results[i].column" gives the value of "column" of
> the i.th row.
Yes, that works fine. But I need to know of NULL values.

> 
> How to determine, how "Null" values are recognized,
> is less a Zope than a database adapter question.
> I would expect, that most (if not all) database
> adapters will map SQL Null to None.
That was what I thought but at least ZODBC won't do this.
What I have found out is, that repr(SQL NULL) == 'Missing.Value'.

> 
> However, even some well established SQL databases do not
> treat Null standards-conform but represent it as
> the empty string. Then, the database adapter has
> no chance to map this to None but must use '', too.
ZODBC won't do this either.

> 
> 
> Dieter
> 

Andreas
**
This email message has been swept by MIMEsweeper for the presence of
computer viruses.

Francotyp-Postalia AG & Co.


___
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] Q: Accessing ZSQL methods from Python

2000-06-07 Thread a . wacknitz

Hi all,

my question is what type or value is returned by a ZSQL method that is
invoked from Python?
Or, more precisely, how can I determine if a field contains a NULL value?
Sample code:

def myZSQLAccessFromPython(self, aParameter):
"""myZSQLAccessFromPython() returns a record set from a database
table."""
#Call the ZSQL method
rs = self.zsqlMethod(parameter=aParameter)
if len(rs) == 1:
#I expect exactly one result column
  if rs[0].field is not NULL:  <- How to code this?
rs[0].field == None does not work
Do_some_interesting_work()

TIA,
Andreas

**
This email message has been swept by MIMEsweeper for the presence of
computer viruses.

Francotyp-Postalia AG & Co.


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




[Zope] Re: Re: [Zope] detail record editing

2000-06-07 Thread a . wacknitz

> On Mon, 5 Jun 2000, Robert Del Huerto wrote:
> 
> > database.  I'm stuck after that.  The form only has one 'action' so how
> > would I get it to handle the right function depending on the button that
> > was pushed?  I'm no HTML expert but I've looked around quite a bit for
> 
> It can be done with some badly documented magic (see 
> http://www.zope.org/Members/Zen/howto/FormVariableTypes when zope.org
> is working again :-P)
> 
> Example:
> 
> 
> 
> 
> 
> 
Wow, live can be so easy ;-)
But I wonder if I can pass additional parameters to the methods.
No,  does not fit my needs as the
parameter to pass has always the same name but different values for each
method.

> 
> In this example, the action is never called. If the user clicks on
> the delete button, the method 'delete' (generally in the same folder as
this
This is not necessary as I have found out. You can give full qualified paths
to the methods eg. .

> form) is called instead of the action. Similarly, click on Modify and the 
> method called 'modify' is called instead of the action.
> 
> I'll try to remember to put this up as a tip on zope.org when its
possible...
> 
> -- 
> Stuart Bishop  Work: [EMAIL PROTECTED]
> Senior Systems Alchemist   Play: [EMAIL PROTECTED]
> Computer Science, RMIT University

TIA,
Andreas
**
This email message has been swept by MIMEsweeper for the presence of
computer viruses.

Francotyp-Postalia AG & Co.


___
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] detail record editing

2000-06-06 Thread a . wacknitz


> I'm just beginning my journey into Zopeland so please forgive my
> ignorance.  I'd like to be able to give users a chance to edit records
> found in a table by selecting the desired record's checkbox and then
> clicking 'Modify'.  This is similar to the Zope management screen.  I
> just don't know how to approach it.
>
> I can get Zope to generate a table and form like this from an SQL
> database.  I'm stuck after that.  The form only has one 'action' so how
> would I get it to handle the right function depending on the button that
> was pushed?  I'm no HTML expert but I've looked around quite a bit for
> an answer and I can't seem to find any info on handling multiple submit
> buttons.  Can Zope make this any easier?  (using ZClasses, maybe?)  I've
> also tried searching through the mail archives but I haven't found
> anything yet.  (There are a lot of messages to go through them one at a
> time.)

My solution for this kind of problem is to have a DTML method that delegates
to the
appropriate DTML methods. Therefore each button gets a value and a name, eg.



The DTML method delegating the calls looks like this:


  


  


  


The except part catches the cases where an error occurs such like action is
not determined.
Beware of the fact that you might want to pass further parameters in order
to determine the
selected item or so.

HTH
Andreas

Francotyp-Postalia AG & Co.
Dipl. Inform. Andreas Wacknitz
Abteilung TEE
Triftweg 21-26
D-16547 Birkenwerder
**
This email message has been swept by MIMEsweeper for the presence of
computer viruses.

Francotyp-Postalia AG & Co.


___
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] Q: Accessing a ZSQL Method from an External Method

2000-05-29 Thread a . wacknitz

Hi all,

I want to use ZSQL Methods from within External Methods and have already
read the appropriate HowTo but it is somehow vague in some respects and
I have some problems with my adaption.

I have ZSQL methods in a subfolder /SQL, eg. /SQL/sqlZuordnung
My External Method named "extShow" should use the ZSQL method sqlZuordnung:

def Show(self, zuordnungsbereich, zuordnung):
"""Show retrieves some database items."""
res=self.SQL.sqlZuordnung(zuordnungsbereich=zuordnungsbereich,
zuordnung=zuordnung)
fields2index={}
fieldnames=res._schema.items()
for i in range(len(fieldnames)):
fields2index[fieldnames[i][0]]=fieldnames[i][1]
id_val=res[0][fields2index['ID']]
return id_val

First, I want to know how to call this function, especially how to submit
the
correct namespace.
Calling it with 
results in
an AttributeError (SQL). Here's a TraceBack:


So, what am I doing wrong here?

TIA,
Andreas
**
This email message has been swept by MIMEsweeper for the presence of
computer viruses.

Francotyp-Postalia AG & Co.


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