[Zope] ZSQL database connection (ZPoPy) not giving expected results

2001-01-09 Thread Mark N. Gibson

Ok, here's the situation.

I create a folderish object.  I insert some info into the postgresql
database related to this folderish object.  I create a ZPopy database
connection within this folderish object.  All of this is done through a
python method.

If I do a query using this new database connection, select for rows I
just inserted.  The query comes back with no results.  I can do this
query using another ZSQL DB connection, and on the command line, it
works fine.

Caching is off for the query.

Eventually, after 30 seconds to 4 minutes, all queries seem to work
fine.  This behavior is inconsistent, sometimes the queries work after
no wait at all.

Any ideas?

___
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] One last request

2000-10-23 Thread Mark N. Gibson

> 
> I have one unsolved mystery left. What I am trying to do is print the titles
> from the DTML Documents in the 'artikelen' folder (and actually another
> property called 'inleiding'. I believe the code below should do this, but it
> does not work. It returns 'Zope' instead of the title. If I use the
> 'inleiding' property it reports that it does not exist. If I just use
> sequence-item it returns the complete item ok.
> 
> Any clues ?
> 
> Thanks,
> 
> Taco
> 
> 
> http://www.gezondheidskrant.nl:8080/mainframe :
> 
> 
> 
> 
> 
> 
> 

> 
>
>
>
>
> 
> 
> 
> 

instead, try this:

 
 
THIS actually 'calls' sequence-item


 
 

 




 

Mark
> 
> ___
> 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] Problems with sequence-item

2000-10-22 Thread Mark N. Gibson

> 
> I get errors when sequence-item is being called to list the contents of a
> folder
> 
> E.g.
> 
> 
> 
> 
> correctly outputs 3 2 1
> 
> When I do
> 
> 
> 
> 
> 
> it correctly outputs all ids in the folder.
> 
> But
> 
> 
> 
> 
> 
> will fail with an error
> Error Type: AttributeError
> Error Value: __call__
> 
> What am I doing wrong ?
> 

In this example,  is actually trying to call the items
in the folder.  In this case, at least one of the items is not callable ( like 
another folder).  If you did something like this:





You would see the results of 'viewing' or calling every DTML Method in folder.

Mark

> Thanks,
> 
> Taco Scargo
> 
> 
> 
> 
> 
>1stUp.com - Free the Web
>Get your free Internet access at http://www.1stUp.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] Creating Object

2000-10-22 Thread Mark N. Gibson

You're logged into the zope management interface as superuser.  

To change this, create a user in the root acl_users folder, giving it a
username and password, and the manager and owner roles.

Now restart your browser, go to the management interface, and log in as
the user you just created.  You should be able to create objects.

Mark


> 
> Hello,
> 
> I am new to Zope
> I've just installed Zope on Linux. I just can't create any object !.
> I receive the following message :
> the object can not be owned by the superuser
> (line 217 in file Owned.py)
> Could someone help me ?
> 
> Thank you very much
> 
> 
> 
> ___
> 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] Dynamically render DTML?

2000-09-18 Thread Mark N. Gibson

Thanks too all who replied,  I may have simplified my problem a little too
much before posting it.
The heart of it is that I'd like to have the Zope evaluate an arbitrary string
as if it were a DTMLMethod

For those interested, here is what I ended up doing...

--
pyfile.py

from OFS.DTMLMethod import DTMLMethod


class myclass:
""" a callable object:
   This is acting as a base class for a ZClass """


   def __call__(self,REQUEST):
   """a callable object - I pass in REQUEST because my dtml-vary seems to
require it """

   # create your dtml string - note: the idea is, this doesn't have to be a
static string...
   text= '\
ENGLIS TITLE\
THIS IS ENGLISH CONTENT\
\
THSI IS FRENCH CONTENT\
\
Spanish title\
This is spanish text\
'

   met h=DTMLMethod()
   # populate the DTMLMethod
   meth.manage_edit( text,'THIS IS THE TITLE')

   #the DTMLMethod goes out of scope here, so it's never persistent ( I hope
).
   return meth(REQUEST)

--

I call this from from zope as follows...

-





 m1 is an instance of a ZClass that has myclass as a base
class.  
 this   calls myclass.__call__(self,REQUEST)







-

This solution worked for me.  It would still be nice if I didn't have to pass
REQUEST explicitly. I could have derived myclass (or the ZClass) from
DTMLMethod,   but I didn't need the DTMLMethod itself to be persistent.
Also, I'm not sure how to intercept __call__ and pas it on to the DTMLMethod.

It's a little ugly, but it works.  It would be nice to be able to just say
 in zope and have it render.

Mark


Kapil Thangavelu wrote:

> "Mark N. Gibson" wrote:
> >
> > Is it possible to return dtml from python, and have it rendered correctly
> > on the page?
> >
> > for example, the python might look like this...
> >
> > def get_header(somevar=1):
> >   if somevar==1:
> >return ''
> >   else:
> >return ''
> >
> > The dtml document in the zodb might look like this...
> >
> > 
> >Body text
> > 
> >
> > When this gets rendered, it's as if the dtml document had
> >  in place of the get_header call.
> >
>
> to have your example work would require multiple or nested passes of the
> dtml-evalutation machinery. so no you can't return a string containing
> dtml and expect it to be evalutated. the machinery expects you to return
> a
> string or value (for dtml-var) to which it will apply formatting rules.
>
> on the web the evalutation machinery automatically calls (possibly
> nested) dtml tags, so this is not a concern, but again it only performs
> the evaluation once.
>
> if you want to achieve this result from python you can evaluate/call the
> standard_html_header in python and return the resultant string. see the
> arguements for DTMLMethod in the /lib/python/OFS folder for exact
> syntax.
>
> doing it from a dtml method would be easier assuming it fits the usage.
> 
> 
> 
> 
> 
> 
>
> Cheers
>
> Kapil
>
> > I understand how to call external methods from dtml, etc.  I just want
> > to know if it's possible to get the string returned rendered as dtml.
> >
> > Mark
> >
> > ---
> > Mark Gibson
> > Kaivo, Inc.
> > www.kaivo.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 )


___
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] Dynamically render DTML?

2000-09-16 Thread Mark N. Gibson

Is it possible to return dtml from python, and have it rendered correctly
on the page?

for example, the python might look like this...


def get_header(somevar=1):
  if somevar==1:
   return ''
  else:
   return ''


The dtml document in the zodb might look like this...

  
   Body text


When this gets rendered, it's as if the dtml document had 
 in place of the get_header call.

I understand how to call external methods from dtml, etc.  I just want
to know if it's possible to get the string returned rendered as dtml.

Mark

---
Mark Gibson
Kaivo, Inc.
www.kaivo.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] Re: Fwd: Re: [Zope] R: [Zope] Invalid Header (0) error

2000-06-23 Thread Mark N. Gibson

We've had the same problem,

Michael Pelletier addressed this question in a previous post,
Check out:

http://www.egroups.com/message/zope/29589?&start=29498

To summarize, 'Zope doesn't like it if there is no html tags before the DTML 
begins.'

To fix our problem, we simply make sure that a html comment as the first line 
in every page, through the standard_html_header.

Hope this helps,

Mark
---
[EMAIL PROTECTED]
www.kaivo.com 

> 
> --- In [EMAIL PROTECTED], Richard Moon <[EMAIL PROTECTED]> wrote:
> 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
> 
> 
> 
> 
>  
> 
> 
> 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
>  > > a_dtml_method> to a dtml method and it generates this error. This 
> >  > > a_dtml_method> is nested inside a  and would definitely
> not be
> > > rendered the first time the 'calling' dtml-method is rendered.
> > >
> > > I took out the  and I still got the same
> error.
> > >
> > > I put a  as the first line of the 'calling'
> method and
> > > everything then renders correctly with no error. Even the
>  > > 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 )
> --- End forwarded message ---
> 
> 


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