[Zope-DB] Database connection in a file system product

2006-04-27 Thread Jonas Nielsen
Is it possible to store a database connection (i.e. a Z MySQL Database 
Connection) in a file system product ? How ?


___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] Database connection in a file system product

2006-04-27 Thread Andreas Jung



--On 27. April 2006 10:54:23 +0200 Jonas Nielsen [EMAIL PROTECTED] 
wrote:



Is it possible to store a database connection (i.e. a Z MySQL Database
Connection) in a file system product ? How ?



What is the sense? You can not store persistent objects. You might store
a reference to the object using some _v_ variables to avoid getting
the DA everytime through acquisition (this makes only sense
if you have performance issues, do you?).

-aj


--
ZOPYX Ltd.  Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376
E-Publishing, Python, Zope  Plone development, Consulting


pgpgBeKlZu7IG.pgp
Description: PGP signature
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Fwd: Re: [Zope-DB] database connection]

2006-01-13 Thread Dieter Maurer
Martin Krallinger wrote at 2006-1-10 16:57 +0100:
thanks for the info. I am actually using zope 2.7 but still I 
encountered this problem.

I think the poster wrote: fixed in Zope  2.7.

Maybe, you try 2.8.5 or 2.9?

-- 
Dieter
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] database connection

2006-01-10 Thread Charlie Clark

On 2006-01-10 at 12:50:41 [+0100], Martin Krallinger [EMAIL PROTECTED] 
wrote:
 Hi all,
 
 
 I am using zope to connect to my postgres database using psycopg.
 Everything works fine, I can connect to the db and do queries, the first
 20 results are displayed correctly, but when I want to display the
 '(Next 20 results)' I get the following error:

This is a standard error in ZSQL's test pages and is due to the fact that the 
query parameters are not included in the link for the next 20 results.

Charlie
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] database connection

2006-01-10 Thread Charlie Clark

On 2006-01-10 at 13:06:30 [+0100], Martin Krallinger [EMAIL PROTECTED] 
wrote:
 Thanks Charlie,
 
 so, how could I solve this problem in my case?

Please keep replies like this on the mailing list.

Well, you can fix the DTML of the page in question so that the parameters 
are carried or simply write a report page with your own batching mechanism 
to pass the parameters through. I think this has been fixed in versions of 
Zope  2.7

Charlie
-- 
Charlie Clark
eGenix.com

Professional Python Services directly from the Source
  Python/Zope Consulting and Support ...http://www.egenix.com/
  mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
  mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/

2005-10-17: Released mxODBC.Zope.DA 1.0.9http://zope.egenix.com/

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! 
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


[Fwd: Re: [Zope-DB] database connection]

2006-01-10 Thread Martin Krallinger
thanks for the info. I am actually using zope 2.7 but still I 
encountered this problem. I am not quite sure what you mean with

modifying the dtml to pass arguments in this case.

The z sql method I use has actually the following parameters:

ref_id
pub_type
title
pub_name
pub_auth_list
pub_volume
pub_year
pub_page
url
keywords


using the sql statement:


SELECT * FROM bib_table
WHERE
ref_id ~ 'dtml-var ref_id' AND
pub_type ~ 'dtml-var pub_type' AND
title ~ 'dtml-var title' AND
pub_name ~ 'dtml-var pub_name' AND
pub_auth_list ~ 'dtml-var pub_auth_list' AND
pub_volume ~ 'dtml-var pub_volume' AND
pub_year ~ 'dtml-var pub_year' AND
pub_page ~ 'dtml-var pub_page' AND
url ~ 'dtml-var url' AND
keywords ~ 'dtml-var keywords'


When I generate the z search interface using the dtml method option I 
still get the error, when I use it as an Page Templates it workes. Does 
anybody know why?


I am not an Zope expert, so it seems somehow strange and I did not find 
any information related to this on the web


thx


Martin
---BeginMessage---

On 2006-01-10 at 13:06:30 [+0100], Martin Krallinger [EMAIL PROTECTED] 
wrote:
 Thanks Charlie,
 
 so, how could I solve this problem in my case?

Please keep replies like this on the mailing list.

Well, you can fix the DTML of the page in question so that the parameters 
are carried or simply write a report page with your own batching mechanism 
to pass the parameters through. I think this has been fixed in versions of 
Zope  2.7

Charlie
-- 
Charlie Clark
eGenix.com

Professional Python Services directly from the Source
  Python/Zope Consulting and Support ...http://www.egenix.com/
  mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
  mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/

2005-10-17: Released mxODBC.Zope.DA 1.0.9http://zope.egenix.com/

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! 


---End Message---
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


RE: [Zope-DB] database connection

2006-01-10 Thread Rivera Merla Jose
On 2006-01-10 at 12:50:41 [+0100], Martin Krallinger
[EMAIL PROTECTED] 
wrote:
 Hi all,
 
 
 I am using zope to connect to my postgres database using psycopg.
 Everything works fine, I can connect to the db and do queries, the
first
 20 results are displayed correctly, but when I want to display the
 '(Next 20 results)' I get the following error:

This is a standard error in ZSQL's test pages and is due to the fact
that the 
query parameters are not included in the link for the next 20 results.

Charlie


Hi

The problem can be found where the page template defines the link to the
next 20 pages, look:

  a tal:condition=previous
   tal:attributes=href
string:${request/URL0}?start:int=${previous/first}
   href=previous_urlprevious span
tal:replace=previous/length20/span results/a
a tal:condition=next
   tal:attributes=href
string:${request/URL0}?start:int=${next/first}
   href=next_urlnext span tal:replace=next/length20/span
results/a
  /p


Do you see the code '?start:int', you should add there the parameters
needed for your ZSQL or take the easy path of change the batch size to a
big number like 65000.

You can do these using this lines:
batch python:modules['ZTUtils'].Batch(results, 
  size=65000, 
  start=start);
instead of:

batch python:modules['ZTUtils'].Batch(results, 
  size=20, 
  start=start);

I hope this can be of any help...

Bye
Jose Rivera Merla
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db