Re: [Zope] ZEO manageUndo not working - DisconnectedError

2015-05-06 Thread Tino Wildenhain


Hi Sebastian,

Am 06.05.2015 um 15:26 schrieb Sebastian Tänzer:
 After further testing I was able to sort this one out by downgrading 
ZopeUndo to 2.12.0 (pip install ZopeUndo==2.12.0 --force —upgrade).
 PyPi only said 4.0 brought Py3 compability. Should I expect any 
problems using ZopeUndo 2.12 + ZEO/ZODB4/ZODB3 with their latest versions?



Undo has long been a standard functionality in Zope2 but proven to be
quite dangerous as it is possible to totally mess up your object
tree.

IIRC undo has therefore been removed even from the ZODB - that is
what you are experiencing with the current version.

What seems to work quite well is to enable history support where you
have access to every old transaction and can compare or copy them
to be on top of the stack - which avoids the problem with disappearing
transactions as Undo has.

Unfortunately out of the box only a few Products have history support
enabled. Some monkey patching can enable it for many of the other
Products of stock Zope2. ObjectManager/Folder is a bit limited
since accessing a whole historic version of a subtree can't be done
easily. However, if you are interested and want to try:

http://old.zope.org/Members/tino/PatchHistory/view

(very old, but seems to work with the 2.12 at least)

Best,
Tino


Best, Sebastian



___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] sending a encrypted login URL

2009-03-04 Thread Tino Wildenhain

Andreas Jung wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Use SSL and you're done.


SSL solves SSO? I don't think so.

Cheers
Tino


- -aj

On 04.03.2009 17:29 Uhr, Joseph Thomas (s) wrote:

We’d like to construct a zope login URL of the form on another server:

 


http://zope.domain:port/context/logged_in?__ac_name=uzz__ac_password=xxxsubmit=Log+in
http://zope.domain:port/context/logged_in?__ac_name=uzz__ac_password=xxxsubmit=Log+in

 

 


where the ac_name and ac_password parameters are encrypted using zope
public key (?) and have the parameters decrypted when zope receives the
request and login the user.

 


Is there an API or some way to encrypt the username and password on the
3^rd party app server and configure zope so that it treats the
parameters as encrypted values rather than plaintext?

 


Joseph Thomas

College of American Pathologists

http://www.cap.org http://www.cap.org/

 





___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce

 http://mail.zope.org/mailman/listinfo/zope-dev )



- -- 
ZOPYX Ltd.  Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany

Web: www.zopyx.com - Email: i...@zopyx.com - Phone +49 - 7071 - 793376
Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535
Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK
- 
E-Publishing, Python, Zope  Plone development, Consulting

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkmurnAACgkQCJIWIbr9KYylKQCgn3WWP5SzGrrAQbJIQXv7Bfac
3fwAoIiI4iwtVBFVRg7jtZu5Vgy5fw3f
=MHol
-END PGP SIGNATURE-

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce

 http://mail.zope.org/mailman/listinfo/zope-dev )





smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-dev] SVN: zope2book/trunk/ Lot's of updates over the weekend!

2009-02-17 Thread Tino Wildenhain

Dieter Maurer wrote:

Tres Seaver wrote at 2009-2-15 10:45 -0500:

...
At the moment, the book is largely a guide to what can be done with Zope
TTW.  DTML is still part of that store: it isn't gone, nor even
deprecated:  its just that most core developers prefer not to use it in
most cases.  Note that there is still no replacement for DTML for at
least one major TTW use case (SQL methods).


In addition, CSS and Javascript is easier generated with DTML than
with page templates.


You should really not generate CSS ;) And JS is best generated with
Jason :-)

Regards
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope] getProperty title and id

2008-10-15 Thread Tino Wildenhain

Tino Wildenhain wrote:

Hamzat Kamal wrote:

Hi,

I just want to why dtml-var xx.getProperty('title') will display 
the object title and and dtml-var xx.getProperty('id') will 
dispaly none.


apart from the fact that you probably should start using TAL instead of 
DTML,



dtml-let xx= _.getitem('id')
dtml-var xx.getProperty('title')
dtml-var xx.getProperty('id')
/dtml-let


Did you look at the resulting output? Not the HTML rendered
in the browser but the source - view source in the browser.



Ah sorry. yes id is not a property but an attribute of xx.

So instead of xx.getProperty(id) you'd use xx.id

Regards
TIno


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] getProperty title and id

2008-10-15 Thread Tino Wildenhain

Hamzat Kamal wrote:

Hi,

I just want to why dtml-var xx.getProperty('title') will display the 
object title and and dtml-var xx.getProperty('id') will dispaly none.


apart from the fact that you probably should start using TAL instead of 
DTML,



dtml-let xx= _.getitem('id')
dtml-var xx.getProperty('title')
dtml-var xx.getProperty('id')
/dtml-let


Did you look at the resulting output? Not the HTML rendered
in the browser but the source - view source in the browser.

Regards
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] use path function on a python script

2008-10-08 Thread Tino Wildenhain

Garito wrote:



2008/10/8 Tino Wildenhain [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]

Garito wrote:

Perhaps is better if I explain you what I'm trying to do

Imagine a Plone site (I know there are a plone list but this is
a generic question, sorry if not)

I configure it in the way if you put a parameter ?print the
plone point renders as when you push the print button at the
bottom of the point

For example: plone_site_url/front-page?print renders the plone
front page with the print.css sytle

Now I want to get the rendered code of this point as string to
pass it to PDFNode.renderAsPdf (it expect a string with the HTML
and the name of the generated pdf)

Did you know how can I get the html code of an url with get
parameters?


just context['front-page'](print=True) ?


Perhaps but this puts print on options/args/print or options/print in 
the page_template scope, isn't it?


In my way to solve this I use request/form/print because plone_css use 
tal expressions and request is passed to it


This would be very ugly. However in this case just set context.REQUEST
or context.REQUEST.form accordingly

HTH
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] use path function on a python script

2008-10-08 Thread Tino Wildenhain

Garito wrote:

Perhaps is better if I explain you what I'm trying to do

Imagine a Plone site (I know there are a plone list but this is a 
generic question, sorry if not)


I configure it in the way if you put a parameter ?print the plone point 
renders as when you push the print button at the bottom of the point


For example: plone_site_url/front-page?print renders the plone front 
page with the print.css sytle


Now I want to get the rendered code of this point as string to pass it 
to PDFNode.renderAsPdf (it expect a string with the HTML and the name of 
the generated pdf)


Did you know how can I get the html code of an url with get parameters?


just context['front-page'](print=True) ?

or something? (Am I the only one which does not see value in a print
button because there is CSS to make this happen without server
interaction? )

Regards
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] delete a variable from REQUEST

2008-09-30 Thread Tino Wildenhain

Hi,

indrajit926 indra wrote:

Hi,

thanks for ur reply.

My problem is, my code is like

#code code code

if REQUEST['usr_msg']:
  do some operations.
 
#some code related to project


my program control loops with above  if condition.

REQUEST is in same context.

so once REQUEST stores 'usr_msg ' every time when it goes to if 
condition  , it performs that do some operations


Due to above reason i want to delete that usr_msg variable from REQUEST


But if you would really manage to delete this from REQUEST, you
would get an exception when trying to use it in the way above.

So, see Peters solution to your problem.

also i cannot put restriction on usr_msg ,because it comes from user 
input, and user can give any text to that variable.


If thats some kind of filter chain you probably want to change
it to some private name space within request as you would be
comfortably getting by REQUEST.set('allmystuff',dict())
at the very beginning. You can actually look up form values
from REQUEST.form to distinguish between user input and
data from your program. If you just ask REQUEST, you get
some kind of stacking layers of name spaces where values get
looked up.

Please see the Zope book (online) for description of the API.

Regards
Tino



thanks,
Indrajit.

On Mon, Sep 29, 2008 at 1:36 PM, Tino Wildenhain [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


Hi,


indrajit926 indra wrote:

Hi All,

Iam relatively new to zope.

I want to delete a variable and it value from REQUEST.I used
python pop() and __delattr__() ,but getting attribute error.


Actually you can't. (Not without writing a product in filesystem
and getting deep into zope). Why would you?

What you could do is to update one of the requests namespace to
give the variable a new value.

Regards
Tino





___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce

 http://mail.zope.org/mailman/listinfo/zope-dev )




smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] delete a variable from REQUEST

2008-09-29 Thread Tino Wildenhain

Hi,

indrajit926 indra wrote:

Hi All,

Iam relatively new to zope.

I want to delete a variable and it value from REQUEST.I used python 
pop() and __delattr__() ,but getting attribute error.


Actually you can't. (Not without writing a product in filesystem
and getting deep into zope). Why would you?

What you could do is to update one of the requests namespace to
give the variable a new value.

Regards
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] kill user Session

2008-09-17 Thread Tino Wildenhain

vaibhav pol wrote:

Dear all,
  I create logout page in my site when user want to logout it 
will submit the page  of page submit i called manage_zmi_logout 
function . which promt me for again  login user name password window i 
want redirect  user to login page  but  if redirect  whiout calling 
manage_zmi_logout function user not actualy logout from zope is any 
other way to kill user session  please tell me.


Is there a question somewhere?

Looks like you are trying to log out a basic auth. This is not
really possible - the protocol has nothing to support it.
What zope does is using a dirty trick - most browsers expire
sending the auth header when they get a 401 response (look up your
copy of rfc2616).

What you probably want is to use a cookie based authorization.

Did you already explore zope PAS?

Cheers
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] 404 on /manage frames with mod_rewrite

2008-08-21 Thread Tino Wildenhain

Bernard Devlin wrote:
I worked it out.  For the apache virtualhost config for 443 I changed 
the rewrite rule to this:


RewriteRule ^/zp($|/.*) http://%{SERVER_NAME}:8080/VirtualHostRoot$1 [L,P]

I probably should have included my rewrite rules in the earlier 
message.  I'm sure my mistake would have been glaringly obvious.


Since 443 is missing in your rule its pretty obviously incorrect :-)

The witch is outputting:

RewriteRule ^/zp($|/.*) \
http://127.0.0.1:8080/VirtualHostBase/https/%{SERVER_NAME}:443/VirtualHostRoot/_vh_zp$1 
[L,P]


and I feel this should work :-)

Regards
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] 404 on /manage frames with mod_rewrite

2008-08-20 Thread Tino Wildenhain

Bernard Devlin wrote:

Hi folks,

I managed to find some good information on putting zope behind apache 
and using mod_rewrite.  This appears to be working fine as long as I'm 
using a non-framed page (and it works with SSL too). 

However, when I try to access the site using 
https://mysite.com/some_zope_page it works, but if I try 
https://mysite.com/zp/manage, I'm prompted for my zope admin 
credentials, and once I submit the credentials the framed portions are 
all 404d.  When I check the url for one of the framed pages it looks 
like this: http://mysite.com:443/manage_workspace.


Maybe you double check using the witch:

http://betabug.ch/zope/witch

Regards
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-dev] Syntax error in python2.6

2008-07-21 Thread Tino Wildenhain

Bristow Thankachan wrote:

Hi everybody,

During the porting of Zope2 to Python2.6, I am stuck with a syntax error 
in the module AccessControl, which is given below.


def reorder(s, with=None, without=()):
   ^
SyntaxError: invalid syntax

in line 56 of /home/zope/ztrunk26/lib/python/RestrictedPython/Utilities.py.
The same code when run in python2.4 and python2.5 didn't give any syntax 
errors. Can anybody suggest  the reason for this syntax error in python2.6.


I'd say, with is now a keyword.

http://docs.python.org/ref/keywords.html

btw, shouldn't this already give a warning in 2.5?

Cheers
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Syntax error in python2.6

2008-07-21 Thread Tino Wildenhain

Hi,


Bristow Thankachan wrote:
...


def reorder(s, with=None, without=()):
  ^
SyntaxError: invalid syntax

in line 56 of
/home/zope/ztrunk26/lib/python/RestrictedPython/Utilities.py.
The same code when run in python2.4 and python2.5 didn't give
any syntax errors. Can anybody suggest  the reason for this
syntax error in python2.6.


I'd say, with is now a keyword.

http://docs.python.org/ref/keywords.html

btw, shouldn't this already give a warning in 2.5?


Actually it does:

python2.5
Python 2.5.2 (r252:60911, Apr 17 2008, 13:15:05)
[GCC 4.2.3 (Debian 4.2.3-3)] on linux2
Type help, copyright, credits or license for more information.
 def foo(with=5):
stdin:1: Warning: 'with' will become a reserved keyword in Python 2.6
... pass
...

So while I'm generally happy with getting zope and python developement
better in sync it seems we have been too fast here since I believe
python2.5 migration is actually still in process and now you are heading
for 2.6? Doing it one after the other should already ruled out such
problems.

I wonder what can of worms is waiting in the restricted python area.

Tino




smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope] TALES expression

2008-07-16 Thread Tino Wildenhain

Garito wrote:

Hi!
Please consider this TALES expression:

div class=DataPrevista tal:content='here/getDataInici | string: nosta' /

If I try this other: div tal:content='string:${here/getDataInici}' / 
the result is divNone/div


Then the first one will render the alternate expression isn't it?

Then with it renders div class=DataPrevista / ?


Сто? ;-)

You should check the tales documentation. the pipe symbol |
means a logical or, in effect if the left expression resolves
to non existent, None, empty object,... (generally python False)
the right part of it is evaluated.

In the special case it probably is nicer to use:

div class=DataPrevista tal:content=here/getDataInici | 
defaultnosta/div instead so the fallback value is part

of the template (TAL is meant to be design by example)

I would also recommend not mixing  and ' for attributes and
maybe in the long run sticking to english language names for
your objects makes it easier to ask on mailinglists.

Regards
Tino



smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] TALES expression

2008-07-16 Thread Tino Wildenhain

Fred Drake wrote:

On Wed, Jul 16, 2008 at 6:34 AM, Tino Wildenhain [EMAIL PROTECTED] wrote:

You should check the tales documentation. the pipe symbol |
means a logical or, in effect if the left expression resolves
to non existent, None, empty object,... (generally python False)
the right part of it is evaluated.


Not at all.

The pipe uses the left-hand operand if it is defined; a value of None
or an empty string is still a defined value.  As long as here can be
traversed with the name getDataInici then the left-hand expression
will be used.  If that traversal fails the right-hand expression will
be used instead.


Indeed :-)

Cheers
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] getting post data from a webcam

2008-07-09 Thread Tino Wildenhain

William Heymann wrote:
I am trying to integrate a webcamera with a site and I can get it to POST the 
data to a certain url on the server the problem is I can't figure out how to 
get access to the data. It is not in REQUEST.form


the relevant request vars are

('CONTENT_LENGTH', '111695')
('CONTENT_TYPE', 'image/jpeg')
('HTTP_CONTENT_DISPOSITION', 'attachment; 
filename=image01-07-29_05-54-26-96.jpg')


This is being posted to a python script object inside zope, however if I need 
to use an external method that is not a problem I just need to figure out how 
to get the data.


If the file is posted as attachment (similar to file upload) it should
appear in the relevant form element as file. You can just use the method
.read() on it to get the data (or feed it into factory of image/file)

For this to work the data needs to be sent as 
enctype=multipart/form-data (hopefully the cam does this).


Maybe you send all variables of the request to figure out.

Regards
Tino



smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] UTF8 encoding

2008-06-18 Thread Tino Wildenhain

Hi Garry,

Garry Saddington wrote:
I am getting a few of this type of error only coming from Windows 
machines, does anyone know how to sort this out?


ProgrammingError: ERROR: invalid byte sequence for encoding UTF8: 0xa3 
HINT: This error can also happen if the byte sequence does not match the 
encoding expected by the server, which is controlled by 
client_encoding. insert into departmentplanning (planningcategoryid, 
taskid, subtasks, moneval, timescale, budget, success, subjectid, 
teacherid) VALUES (1 , 186 , 'Identify suitable tasks and activities for 
all G+T pupils and students ' , 'ADE- liaise with HS and GE' , 'JUL08 
on' , 'SOme activities could be bought in ~£50' , 'All G+T pupils and 
students given opportunity for enhanced work' , 1787, 41 )


You give us very little to base our suggestions on. From what I see
it looks like you are using a RDBMS, seems to be Postgres, and
the python binding (psycopg?) reports you this exeption. It also gives
you hints about the reasons. Maybe you see if you can follow that?
IIRC, recent ZSQL-driver for postgres allow for setting the encoding,
you should use that, also setting this in the database for the
user you are connecting with should be possible if everything else fails.

In any case please try do give more details about your setup.

Cheers
Tino



smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] display HTML files using TAL

2008-06-09 Thread Tino Wildenhain

Hi,

sujitha mary wrote:

Hi all,
I need help in displaying a set of HTML files .I have created a TAL code 


explain display.

which stores the name of the files in a list.But i don't know how to 
pass this values.


pass to where? How does a code store anything? To where?


this is my code
here 'x' is the list that contains file names. i have uploaded the files 
as DTML document.


span tal:condition=python:n=='geneprot' tal:replace=structure 
python:here.xthis  will be replaced/span


You want to replace span / with the contents of here/x?
Why do you think you need structure or python: ?

maybe you can tell us where exactly your approach fails?

Regards
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Counting the elements of a result in a ZCatalog

2008-06-05 Thread Tino Wildenhain

Hi,

Marco Bizzarri wrote:
...

if result:
  result_len = results.actual_result_count
else:
  result_len = 0

return result_len


...


Thanks for your answer, but there is something I do not understand:

if results:

an empty result from ZCatlog is false in a boolen condition?


Yes, thats standard Python behavior, empty lists, dictionaries
and similar objects are assumed False when used as boolean.

This means you could even write it this way:

return (results and results.actual_result_count) or 0

in python2.5 (not yet supported by Zope) even:

return results.actual_result_count if results else 0

Cheers
Tino



smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] statistics and click analysis for a plone site

2008-06-02 Thread Tino Wildenhain

Hi,

robert rottermann wrote:

Hi there,
for a Client using a plone2 intranet (with no access from the outside 
world) I installed awstat to track the usage of the intranet.

now I wonder how meningfull such statisics are.


I guess you have something like apache in front of the zope,
if so you can make a custom log format (with relevant fields,
separated uniform, e.g. tabs) and spool them in a database,
for example I used some tables in postgres: uris (uri_id,'/foo/bar')
queries (query_id,'?foo=bar')   methods (method_id, 'GET'),
hostnames (host_id,'www.foo.de')
access (timestamp,host_id,bytes,time,method_id,uri_id,query_id )

with an insert-script and then you can easily run reports against
those structured data. You can also include various request parameters
I did not show above (like session cookie, auth_user, ...)

Regards
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Displaying Graphs using TAL

2008-05-30 Thread Tino Wildenhain

Hi,

Andyy wrote:
i am preparing graphs(MatPlotLib) related files using external methods., 
when i test them on zope they display very well there.


But when i call these external methods using tal as:

Img tal:attributes=src python: context.IterationBar(context) /
where IterationBar is my external method that displays a BarChart.


No, well you need to understand how HTTP/HTML works. If you have
a method which outputs the data of the image, you can point your
browser to it and it will load. If you want to embed the image
into a HTML page you need to give the link to the method in
img src=... / _not_ the image data itself (look into
document source in your browser to find out about the difference.

In short, the very URL you have in your address bar when you view
the image itself should go into src= attribute.

Sounds easy, yes? Give it a try :-)

Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: Displaying Graphs using TAL

2008-05-30 Thread Tino Wildenhain

Hi,

Encolpe Degoute wrote:
...


 If your site is only for FireFox or evolved browser you can use inline


not only Firefox. also Opera supports this for years :-)
It is not totally ideal because of the overhead due to the
base64-encoding.

For graphs (as the op wants to show) I think in the long
run SVG would be a better option (gnuplot can output SVG)

Regards
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-dev] sad news about Joachim Schmitz

2008-05-14 Thread Tino Wildenhain

Martijn Faassen wrote:

Hi there,

Joachim Schmitz, long-standing member of the Zope community, died last
weekend. Please see the following:

http://faassen.n--tree.net/blog/view/weblog/2008/05/14/0


unbelievable... Yes I also met Joachim. Don't know much to say
but I feel sorry for his family.

Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope] Making Zope stop storing old object versions

2008-05-09 Thread Tino Wildenhain

Hi,

Jonathan wrote:

Sinang, Danny wrote:
Hello,

...

You can also try some of the other storages like relstorage (where it
depends on the RDBMS how it handles writes)


Alternatively, you could just replace your Catalog with an external db 
such as MySQL (using zmysql database connections).


well if MySQL is the right tool and does not introduce other problems.
It should be pointed out that along the powerful open source DBs there
is for example also postgresql which is extreamly good at handling 
concurrent loads.


Cheers
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Making Zope stop storing old object versions

2008-05-07 Thread Tino Wildenhain

Hi,

Sinang, Danny wrote:

Hello,
 
We've got lots of Catalog reads and writes and our Data.fs is growing 
at an immense rate. 
 
Is there a way we can tell Zope to stop storing old object 
versions to limit the growth and not have to pack that often ?


Well in fact it (Filestorage) does only store new object versions.
What it does not is removing the old version - this is done during packing.

When you have many Catalog writes or other parts of your object tree
experiences many writes, try to mount an extra ZODB (and storage) there.

You can also try some of the other storages like relstorage (where it
depends on the RDBMS how it handles writes)

Cheers
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-dev] Non-ASCII characters in URLs

2008-04-09 Thread Tino Wildenhain

Dieter Maurer wrote:

Wichert Akkerman wrote at 2008-4-7 20:45 +0200:

...

Almost surely, Alexander wants to ask why Zope does not allow
non-ASCII characters in ids.

And, in fact, there are only two reasons:

  *  lazyness of the Zope developpers:

 without the restriction to ASCII characters
 careful quoting (and unquoting) is necessary
 in order to adhere to RFC 2396 (the modern uri syntax specification)

This is becoming increasingly painful


I will soon have a patch against Zope 2.11b1
which gets rid of this restriction.

If there is consense, I can add it to the Zope repository.


+1 from my side. Saves me the work to cleanup my own dirty
patch :-))

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: GSoC proposal

2008-04-04 Thread Tino Wildenhain

Malthe Borch wrote:

On 04/04/2008, Chris Withers [EMAIL PROTECTED] wrote:

 zope.security uses RestrictedPython, iirc...


For untrusted python, yes –– but is anyone using this (in Zope 3)?

It's integral to most Zope 2 applications of course to allow secure
execution of Python scripts, so we will need to port RestrictedPython
eventually.


Btw, it would also be nice to have RestrictedPython outside of Zope
for example to use in pl/python (postgres pluggable function language)

Of course this smells like another GSoC project...

Greets
Tino
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope] running in debug mode

2008-03-26 Thread Tino Wildenhain

David Bear wrote:
Is it possible to have one zeo client running in debug mode while another is 
not? It seems that it should be the way most people would make a development 
environment. One zeo is running in standard mode so you could see how the 
site performs -- while the other zeo is running in debug mode so you can do 
file system development.


Yes of course it is. And why didn't you just try it out?

T.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope utf-8 problem using MySQL

2008-03-22 Thread Tino Wildenhain

Hugo Ramos wrote:

yellow,

It's a question of taste... I use a Macbook Pro/Leopard laptop instead
of a PC/win32 laptop... Also a question of taste! :-)


Guess you got the taste thing a bit wrong ;-) MySQL is the PC/win32
in your picture :-)

Cheers
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope utf-8 problem using MySQL

2008-03-22 Thread Tino Wildenhain

Hugo Ramos wrote:

What would you recommend? :-)


What should the database do for you? How did
you select?

T.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: Managing Zope objects in Subversion

2008-03-21 Thread Tino Wildenhain

Tres Seaver wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tino Wildenhain wrote:

Dieter Maurer wrote:

When I remember right, Tres has a product that allows to
dump and restore standard Zope objects to/from the file system.
I forgot its name but you should be able to find it via
your favorite search engine.

I wonder if Tres has also finished DAV support of Zope to also
support DeltaV - this would make Zope immediately a SVN server
- problem solved :-)

Well... wishfull thinking ;)


Tres never even *started* adding Delta-V support, beyond reading the
specification and speculating about how hard it would be. ;)


Yes I know ;) Btw, how hard would it be? Provided to just use
hysterical versions of objects (and forbid/disable packing)?

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope utf-8 problem using MySQL

2008-03-21 Thread Tino Wildenhain

Hugo Ramos wrote:

Yellow ppl,

I'm using Zope 2.10.5 + MySQL 5.0.51a + MySQL-python-1.2.2.


Why? I mean, is there a special business reason to use MySQL?
Just curious...


T.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] define a class in a python script

2008-03-06 Thread Tino Wildenhain

Hi Yuri,

Yuri wrote:

Tino Wildenhain wrote:

Yuri wrote:

Hi, all!

I would like to define a class inside a python script (so I can 
catalog it and use catalog to store info, as the tutorial about 
catalog everything suggests).


Its not possible in Python Scripts. You would need to write either
an external method or a small product.


http://www.faqs.org/docs/ZopeBook/ScriptingZope.html

You also cannot easily hand instances of your own classes over to DTML 
or scripts. The issue here is that your instances won't have Zope 
security information. You can define and use your own classes and 
instances to your heart's delight, just don't expect Zope to use them 
directly. Limit yourself to returning simple Python structures like 
strings, dictionaries and lists or Zope objects.


So developing a product, is the only option?


Well actually its not so hard as it seems. And products are more
easy to handle then external methods (initializing is more clear).

All you need to create a folder with a good name for your project
in the instance or common Products folder (depending on your
zope.conf ) then copy 
ZOPE_ROOT/lib/python/Products/PythonScripts/module_access_example.py to 
YourFanceProduct/__init__.py


then you edit this file to your likings based on both the documentation
(yes I know this is a bit sparse) and the hints given in that file.

Not you can define your own classes and functions in this file as
well. For better structure you are encouraged to create actual
module files in that directory instead of writing everything
into __init__.py once your create more then just a toolset.

Regards
Tino


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] define a class in a python script

2008-03-05 Thread Tino Wildenhain

Yuri wrote:

Hi, all!

I would like to define a class inside a python script (so I can catalog 
it and use catalog to store info, as the tutorial about catalog 
everything suggests).


Its not possible in Python Scripts. You would need to write either
an external method or a small product.

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Managing Zope objects in Subversion

2008-03-03 Thread Tino Wildenhain

Dieter Maurer wrote:

[EMAIL PROTECTED] wrote at 2008-3-2 14:17 +0100:
We use Zope for the  user interface part of our software product. 
We currently export the whole folder hierarchy into a .zexp file and
maintain this file in Subversion. 

I'm looking for a way to manage a folder structure as individual 
Zope objects in Subversion. 


When I remember right, Tres has a product that allows to
dump and restore standard Zope objects to/from the file system.
I forgot its name but you should be able to find it via
your favorite search engine.


I wonder if Tres has also finished DAV support of Zope to also
support DeltaV - this would make Zope immediately a SVN server
- problem solved :-)

Well... wishfull thinking ;)

Cheers
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-21 Thread Tino Wildenhain

Hugo Ramos wrote:

Well,

I went googling for this error... Google gives 1 (one) answer!!! The
worst part is that it's related to django and mod_python.

I guess nobody solved this yet... I'll have to go back to OS X 10.4 (Tiger).


You could also forward to Postgres :-) Unless you have a very specific
need for mysql...

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] POST version of Response.redirect

2008-02-15 Thread Tino Wildenhain

Hi,

Jonathan wrote:
I have a case where I need to redirect users from my Zope site to a 
third-party web site and send POST data that I generate.


The only information I can find on RESPONSE.redirect relates to the GET 
format.  Is there a POST version of RESPONSE.redirect and if so, how is 
the POST data included?


No its not. It helps to have an eye on the HTTP-Spec some time :-)
People circumvent this limitation sometimes by means of Javascript.
(Basically posting a form) - often you can skip the Javascript
and let the user send the form intentionally.

BTW, this isn't related to ZWiki :-)

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Happy Valentine's Day from Zwiki HQ

2008-02-15 Thread Tino Wildenhain

robert rottermann wrote:

Simon Michael schrieb:

Hello Zopistas.. a happy Valentine's day to all!


as martin said (or hinted) before me, a new wiki solution needs to be
seamlessly integratable into plone.

I like zwiki very much and still use it often. but rarely in new projects.
the userinterface is to different from plone.

thanks for the incredible useful zwiki you provided us with.

if you move towards something plonelike, I would be happy to help.


Still I'm not so much a friend of Plone. While having the hooks
in place, a lightweight wiki-core would really be great.

Perhaps split into document type/parser/editor, storage and
link calculation engine, searchcatalog and security?

Then just some glue code to adapt to plain zope, CMF, Plone, Five...

I mean the biggest improvement would be skipping that DTML stuff ;))

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope ZMI Templates

2008-01-17 Thread Tino Wildenhain

Hi Tim,

Tim Nash wrote:

The other important difference between ajax loaded pages and iframes
is that when you click on a link within an iframe page, the returned
page is loaded into the same iframe.
If I am not being clear, please check out this png file.
a href=http://medicinebrain.com/iframe.png;
http://medicinebrain.com/iframe.png
/a
In this png I did a search for DML Docs within a tab panel and the
search results are loaded into the same tab.

BTW, I would like to simplify the zmi even more for my users. I want
to hide various tabs (eg. security, find, etc) and I want to restrict
the number of products they are shown in the drop down box for adding
to a folder.
However, I still want to offer complete zmi functionality to the
overall administrator.
I can probably hide the security tabs using css (the overall admin
won't load the css sheet) but how can I control the products displayed
to a user in the folder view of the zmi?


You can either sub-class if you want to explicitely specify the products
you want an objectmanagerish class to add - this would also nicely solve
all your ZMI problems since you could just skin your new pages as you
want. Or for the easy way have a look at the Security Tab, specifically
at the Add FooBar... stuff there.

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope ZMI Templates

2008-01-17 Thread Tino Wildenhain

Andreas Jung wrote:
...
Iframes are still a valid choice in case asynchronous won't work e.g. 
when you need to load resources from servers != your origin server. Due 
the security model of asynchronous requests, a browser will only load 
stuff from the origin server. Iframes are a way to work around this 
limitation - ugly as you said, but sometimes a good workaround.


Not only ugly but also a very security threat. Been there, seen a lot
important sites fell on their noses when it comes to CSS* and friends.
Better find another solution in such cases and allow users to disable
support for iframes for better security.

*) here: cross site scripting

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope ZMI Templates

2008-01-16 Thread Tino Wildenhain

Tim Nash wrote:

Jurian,
  While the ZMI is a bit geeky for the average user, it works quite
well inside an iframe.
iframes are used by many ajax/web2 (whatever you want to call it)
libraries. So in my application (for example) I currently make ajax
calls to load specific zmi pages inside tabs of a window layout.


IFRames. You should avoid those. With ajax or similar its easy to skip
such stuff and just replace any named container tag.

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: Best Practice for including Javascript in Zope Applications

2008-01-01 Thread Tino Wildenhain

Andreas Jung wrote:



...

Larger JS frameworks like Dojo tend to be split across several files and
directories. The fun starts when such frameworks load/reload stuff
using relative URLs. A co-worker using Dojo intensively had to invest
some time in order to integrate such a JS monster properly. As far as I
remember Extjs also uses multiple files (but not as much as Dojo
does)..so please check in advance.


Another point: consider using CMF and putting your library files into a
directory system view on the filesystem. This makes your life much easier.


Or just upload via WEBDAV.
One of the biggest advantages of Zope is the isolation from physical
file system.

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] backup full instances

2007-10-27 Thread Tino Wildenhain

Hi,

Jonas Meurer schrieb:

On 27/10/2007 Andreas Jung wrote:

If you create a local copy, it is safe. If you rsync a running Data.fs,
it  is not safe. In this case you create a local copy and rsync the copy.

but if rsync is unsafe only because it takes long time, and changes on the
instance during the copy process could cause a corrupted Data.fs to be
backuped, then theoretically this could happen for a local copy as
well, right?

Think twice about your last sentence. What should cause a local *copy*
to be changed??


zope might write to the Data.fs while it is copied, thus an inconsistent
copy would be backuped, even inside one filesystem.

i've asked in #debian on freenode as i wasn't sure, here's the log:

 mejo if i copy a large file inside a mounted filesystem (ext3), is it
possible that the file is changed during the copy process?
 Wyzard mejo: Yes, it's possible that something else can write to the
file while you're copying it
 mejo because i asked on the zope-users mailinglist if i could backup
the global Data.fs (database) while the daemon is running, and
someone answered:
 mejo If you create a local copy, it is safe. If you rsync a running
Data.fs it  is not safe. In this case you create a local copy
and rsync the copy.
 Wyzard mejo: Making a local copy is faster, so it'd be safer, but
still not completely safe
 mejo exactly, that's what i thought as well.
 mejo but when i wrote that, he replied:
 mejo Think twice about your last sentence. What should cause a local
*copy* to be changed??
 mejo so he's wrong?
 Wyzard I'd say he's wrong
 Wyzard A local copy isn't instantaneous, and Zope changes the file
while it's being read
 wols_ he is wrong yes
 mejo thanks. is it ok for you if i quote you in my reply mail?
 Wyzard mejo: sure
 wols_ mejo: while copying zope could change the database and create
an inconsistent state


Nobody is wrong. Your #debian guys just had not all informations.
Zope is always appending to Data.fs, copy (cp) works linear, so
it would always maintain a consistent state of this file.
(It either copies before or after the last append operation)

rsync on the other hand is very efficient by calculating only
differences of the file contents to be copied. This may or may
be not following the order of blocks in the file. In the latter
case it could try to sync wrong information. (You would need
a special rsync which would only transfer new blocks at the end
in their given order - you could script something like this
using dd, gzip/zcat, ssh.

Regards
Tino





___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-dev] Re: Moving the Zope 2 bugtracker to Launchpad

2007-08-12 Thread Tino Wildenhain

Philipp von Weitershausen schrieb:

Martijn Pieters wrote:

On 8/12/07, Andreas Jung [EMAIL PROTECTED] wrote:

to make it short: I propose to move the Zope 2 bugtracker to
Launchpad. Since the Zope 3 bugtracker works already with success on 
LP we

should follow with the Zope 2 bugtracker. Objections?


+1

I do wish LP gave a bit more context in their emails though; today
Christian Thuene cleaned up the Z3 bugtracker and I couldn't tell from
any of the many bug emails if any related to bugs I cared about. I'll
have to file a LP feature-request, I guess.


I agree, I too wish that Launchpad emails would include the full bug 
history (at least as an option). Whenever I've talked to the Launchpad 
folks they were open for ideas, so I think it's worth a try to file a 
feature request.



Maybe I missed the thread but why was LP choosen over for example
Trac? The latter would at least work very well with the SVN repository
and provide meaningfull emails...

Regards
Tino
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope] Problem w/ ZMySQLDA

2007-07-18 Thread Tino Wildenhain

[EMAIL PROTECTED] wrote:

Forgive my ignorance, but not quite sure how to do that. Nonetheless...
1) There was no problem with any of this on the old server until the 
server crashed.
2) My backups were taken from a time when the old server was was working 
fine.


Did you ever check these backups? We are talking mySQL here which has
a lot of nasty bugs regarding reliability.


3) This problem occurs with *all* my shopping carts, not just this one.
Consequently, I have a hard time believing this is a code error. There 
*must* be something more fundamental at play here.


From what you wrote further down it looks like a threading issue with
the mysqlda. You would have to write a test case to isolate it.
Easiest if you set thread number in zope to 1 and test. This should
work similar to single threaded application.

Regards
Tino







___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] SQLAlchemy 0.2 released - a generic database adapter for Zope 2

2007-05-05 Thread Tino Wildenhain

Andreas Jung schrieb:


I am pleased to announce the first public release of

 SQLAlchemyDA V 0.2.0


Nice, saves me a lot of time :-)
Btw, what do you think about an idea to (alternatively)
configure db-connections in zope.conf? Just to
add security (nobody could read credentials, nobody
could connect to whatever host/port he wants)

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] RE: Problem Getting dtml-with to work

2007-04-30 Thread Tino Wildenhain

Andreas Jung schrieb:



--On 30. April 2007 11:02:29 -0400 Mark, Jonathan (Integic) 
[EMAIL PROTECTED] wrote:



Thanks to the other Jonathan for advising me to try dtml-in objectIDs
to find why dtml-with was not working as expected with FolderB. When I
did that I realized that FolderB was not an actual folder. Rather, it
was a Plone instance.



Just the usual rant: do you have 3 good reasons for using DTML over ZPT? 
:-)


1) you mean ZPT and python script
2) one reason could be nobody rearranged
   the Zope-Book chapters in a way to
   move DTML chapter out of first sight ;-)

SCNR
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] What's the tal expression to test for whether someone is logged in?

2007-04-01 Thread Tino Wildenhain

Ken Winter schrieb:

Andrew ~

Yes!! It worked.

One more question: Where (if anywhere) could I have looked up this answer
(and probably many more), so I wouldn't have to bother this list with
questions like this?


Its in the general Zope API and in the ZPT documenation regarding the
name spaces you use. Both are in the Zope-Book which is online:

http://www.plope.com/Books/2_7Edition

Also an older version directly at zope.org.

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How can I reset zope time???

2007-03-24 Thread Tino Wildenhain

Flemming Bjerke schrieb:

On Fri, 23 Mar 2007 16:16:55 +0100
Andreas Jung [EMAIL PROTECTED] wrote:



--On 23. März 2007 16:09:15 +0100 flem [EMAIL PROTECTED] wrote:


I think this kind af date-deadlock is a vulnerability of the zope
architecture. Is it the same thing with zope3? Isn't it an unnecessary
vulnerability that an open zwiki comments field - or any other object
making act open to the public where the anyone can set the date - can
corrupt the time system irrepairbly.

Shouldn't there be some solutions:

1. A script could reset all relevant dates and the timestamp i the zodb.

2. The zope code should be changed so that the timestamp depended
directly on the pc-clock notwithstanding the dates of the objects thus
allowing for going backward in time.


I am not getting the point. What do you want to tell us?

That I think it is a vulnerability that a person can irrepairably corrupt zope's date system by sending one request with a wrong date (in my case using the default open comment opportunity in zwiki). 


Well, but this one can't be truth. ZODB time stamps are generated
in the ZODB layer and not taken from request. In fact, the concept
of a request is completely unknown to ZODB.

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] dtml Z SQL doubt

2007-03-22 Thread Tino Wildenhain

Remil Mathew schrieb:

Hi all,

I need to insert a row to mysql table if the corresponding  data not 
exist, if it exist i need to update the row.


Can we do it using a single Z SQL method.


Well thats not business of ZSQL methods but rather
stuff you do with the instruments of your database.
Say SQL (or whatever SQL like mysql has there)

IIRC, mysql has some kind of UPSERT which should
handle it. If not, stored procedure or trigger
etc could do it.

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: open image in a fitted new window

2007-03-22 Thread Tino Wildenhain

Tres Seaver schrieb:
...

The only trick here is to get the javascript to include the dynamic
URL;  everything else is not specific to Zope or ZPT.  Here is the hack
I usually use for that::

  !-- assumes that 'image' is bound to an actual Zope image object --
  script type=text/javascript lang=JavaScript
  tal:define=img_url image/absolute_url
  tal:content=string:var img_url='${img_url}';/script

Your popup javascript can then refer to the 'img_url' JS variable to set
the window location.



A little bit cleaner approach would be to have an ordinary link:

a class=magnify href=path/to/big/imageimg src=path/to/thumbnail 
width, height ... //a



and have a general javascript which scans thru the DOM after load,
finds the a-objects with class-attribute magnify and installs
an handler for mouse click which overrides the usual link action
and either pops up a window or uses layers the big view on top
with little DOM action (preferred). You dont even net buzzy Ajax
for this. The URL for the big picture is just encoded in the HTML
already, so you can use the usual tal: attributes to define in
ZPT.

The result is clean xhtml code which works in any case and only
is improved in case of javascript beeing available.

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How do people work with html-designers?

2007-03-16 Thread Tino Wildenhain

Chris Withers schrieb:

Martijn Pieters wrote:

That, for ZPT, was sadly a myth.

Not a myth at all. Perhaps underutilised and not as robust as first
hoped, but not a myth. At Pareto the designer and templater were quite
comfortable with keeping TAL intact while using graphical tools.


My experience has been that as soon as you put any of the common visual 
html tools into the mix, they happily strip out tal: and metal: 
attributes :-(


Which ones do that? Certainly not the infamous DW...

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Two mysql / timestamp related fixes

2007-03-09 Thread Tino Wildenhain

Gaute Amundsen schrieb:

On Thursday 08 March 2007 17:27, Tino Wildenhain wrote:

Gaute Amundsen schrieb:

Hi.

snip

1 )
First I got a ValueError 'query' when using a very simple zsql method.
(consisting of only dtml-var sql )

Thats a very bad idea. Better make zsql methods
for every query 


I know the orthodoxy :-/
I'd rather have a proper DB library, (or model layer, if you will) 
and build my SQL in python. 


So you want to use SQLAlchemy? Feel free to write a product
as wrapper :-)


To build anything complex or generalized in dtml is a PAIN.


Is it? Can you come up with examples?


And a sea of too specific templates is even worse.


Well from some level of complexity you could also use
database functions. But if its so complex, why using
MySQL?

instead of 
rebuilding your own (obviously not working)
templating for SQL. 


I's not a template, it's a wrapper to get around the whole mess.
A hack in fact ;)

If a template this simple dtml-var sql  is obviously not working
then it is ZSQLMethods that have a problem, not me.


No, the content of your variable sql is wrong :-)
dtml-var sql would indeed work if it contains valid sql
code.


(it's working fine now.)

Quoting is done automatically 
when you use dtml-sqlvar ...


I can use sql_quote when I need to, thankyou.


this does not need to work identical - but current
adaptors indeed do their handmade quoting.



The only thing that I worry about is transaction support.
insert foo; select last_inserted works when built inside the template with 
dtml, but not with the exact same statement passed to this wrapper.

Probably another bug, but I have not taken time to dig properly into it yet.


Yes, MySQL doesnt want ; as sql-delimiter. It rather wants \0 and sql
methods hack around it for you if you put the template there.

Transactions are maintained thrughout your session (read: request)
so there is no need to squeeze it all into one ZSQL call. Every
subsequent ZSQL call inside your request will be in the same
database transaction.


Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Calling a Variable

2007-03-09 Thread Tino Wildenhain

Martijn Pieters schrieb:

On 3/8/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I thought I could call a variable in a page template by defining it 
and then

putting a ? in front of it in a URL, like this:


Incorrect, you can only use ? to interpolate variables into a path 
expression:


 span tal:define=foo string:bar
 tal:content=here/?foo/span

The above example will look up 'bar' and render it as the content of the 
span.



I notice ZPT gets weirder and weirder...
How many syntactic specialities will we add to path expressions? ;)
Why not keep it simple? :-)

Or make it simpler by removing even tal:define ...

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] No space left on device

2007-03-09 Thread Tino Wildenhain

Maciej Wisniowski schrieb:
 

Where? I added this line to zopectl and rebooted:


rebooted? Lets hope you only restartet zope :-)


Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Tino Wildenhain

Andreas Jung schrieb:



--On 9. März 2007 14:42:57 +0530 Remil Mathew [EMAIL PROTECTED] wrote:


Hi,
How can run  multiple query in an Z sql method..


Sure. SQL Statement just have to separated by dtml-sql-delimiter.

I am using Mysql..

Also is there any method to return a value from insert query?


An insert statement does not return a value! If you are working
with sequences for generating the primary  key you might perform
a select on the current value of the related sequence.


Well, it can. See RETURNING clause:
http://www.postgresql.org/docs/8.2/static/sql-insert.html

but I doubt mysql supports this ... checking ... no, it doesnt.

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Two mysql / timestamp related fixes

2007-03-09 Thread Tino Wildenhain

Gaute Amundsen schrieb:

On Friday 09 March 2007 09:40, Tino Wildenhain wrote:

Gaute Amundsen schrieb:

On Thursday 08 March 2007 17:27, Tino Wildenhain wrote:

Gaute Amundsen schrieb:

Hi.

snip


1 )
First I got a ValueError 'query' when using a very simple zsql method.
(consisting of only dtml-var sql )

Thats a very bad idea. Better make zsql methods
for every query

I know the orthodoxy :-/
I'd rather have a proper DB library, (or model layer, if you will)
and build my SQL in python.

So you want to use SQLAlchemy? Feel free to write a product
as wrapper :-)


Hm.. have never quite gotten around  to writing my first product.
Looks like a very nice candidate, but no promises :)


To build anything complex or generalized in dtml is a PAIN.

Is it? Can you come up with examples?


tabell:string
felter:list
INSERT INTO dtml-var tabell sql_quote SET
dtml-in expr=felter.keys()
  dtml-let key=sequence-item value=felter[key]
dtml-unless sequence-start,/dtml-unless
dtml-var key sql_quote =
dtml-if expr=same_type(value, 1)
  dtml-sqlvar value type=int
dtml-elif expr=same_type(value, 1.0)
  dtml-sqlvar value type=float
dtml-else
  dtml-sqlvar value type=string
/dtml-if
  /dtml-let
/dtml-in
dtml-var sql_delimiter
SELECT LAST_INSERT_ID()

and that is not _really_ complex is it?


Well, it looks a bit silly - I mean you make
a hand-written ORM? This would be the time to
either write a real ORM as product or try
some of the available: ZPatterns, Archetypes, ...

Usual database interacting zope solutions
have only a handful insert places where you
need bulk inserts. And even then you can just
call one ZSQL method (per table) in a loop
to insert your values from a list.

More, sql_quote does not really work
for tablenames or column names - it
may work by accident for MySQL though,
but not for standards compliant databases.



There's the whole sqlgroup thing.


Well to be honest I never used it ;)

dtml is after all depreciated, so I can see no reason to learn it as torougly 
as ZSQLMethods obviously requires when I can use python instead.


You always can but what do you gain? How does your python script
code look like for the above problem?


And a sea of too specific templates is even worse.

Well from some level of complexity you could also use
database functions. But if its so complex, why using
MySQL?

Don't see quite what you mean here, but it would be just the same problems 
with PGsql.


Not direct related but if you have complex queries,
e.g. join over many tables, partial indexes, subqueries, ...
it may be a bit hard to get reliable performance with MySQL.
I think it was related to different views at the word complex
queries


instead of
rebuilding your own (obviously not working)
templating for SQL.

I's not a template, it's a wrapper to get around the whole mess.
A hack in fact ;)

If a template this simple dtml-var sql  is obviously not working
then it is ZSQLMethods that have a problem, not me.

No, the content of your variable sql is wrong :-)
dtml-var sql would indeed work if it contains valid sql
code.


It did not. 
That was the whole point of this mail.


The method was dtml-var sql  and the sql was select * from foo
care to spot the invalid code in that?


wait... your variable really is named sql? Maybe that is
the problem. I did not verify this but it could be. DTML
is sometimes weird ;)


(it's working fine now.)


Quoting is done automatically
when you use dtml-sqlvar ...

I can use sql_quote when I need to, thankyou.

this does not need to work identical - but current
adaptors indeed do their handmade quoting.


The only thing that I worry about is transaction support.
insert foo; select last_inserted works when built inside the template
with dtml, but not with the exact same statement passed to this
wrapper. Probably another bug, but I have not taken time to dig
properly into it yet.

Yes, MySQL doesnt want ; as sql-delimiter. It rather wants \0 and sql
methods hack around it for you if you put the template there.



Hm.. interesting, but I looked into it a bit, and I can't find where this 
happens.

I see that ZRDB/DA.py does: argdata['sql_delimiter']='\0'
Tried a query = query.replace(';','\0') at line 444, but to no effect :)


Interesting. I must admit the whole ZSQL Code is very old and ugly
and I even removed some parts in my private installations ;)



Suggestions?
I guess this could be a problem with LAST_INSERT_ID, forcing me to use 
ZSQLMethods, or dome ugly workaround  for inserts, where I need the id 
afterwards.


Last_insert_id is really part of the uglyness of mysql. But you would
work around with distinct ZSQL Methods. See these methods as interface
and really methods of your database to interact with your data model.


Transactions are maintained thrughout your session (read: request)
so there is no need to squeeze it all into one ZSQL call. Every
subsequent ZSQL call inside your request will be in the same
database transaction

Re: [Zope] Two mysql / timestamp related fixes

2007-03-08 Thread Tino Wildenhain

Gaute Amundsen schrieb:

Hi.

Just had som troubles when I added timestamp columns to a table.
Commnets?


my setup:
Mysql: 4.1.20-log
 Zope Version: (Zope 2.7.5-1.fc3, python 2.3.4, linux2)


1 )
First I got a ValueError 'query' when using a very simple zsql method.
(consisting of only dtml-var sql )


Thats a very bad idea. Better make zsql methods
for every query you want to issue instead of
rebuilding your own (obviously not working)
templating for SQL. Quoting is done automatically
when you use dtml-sqlvar ...


(I am not totally sure this is related to the timestamp  column)

I appled the fix to customDefaultReport.dtml  mentioned in 
http://mail.zope.org/pipermail/zope-db/2005-June/004219.html


 a 
href=dtml-URL;?query_start=dtml-previous-sequence-start-number;query=dtml-var 
query url_quote

---
a 

href=dtml-URL;dtml-sequence-query;query_start=dtml-previous-sequence-start-number;
25d24
  a 
href=dtml-URL;?query_start=dtml-next-sequence-start-number;query=dtml-var 
query url_quote

26a26
 a 

href=dtml-URL;dtml-sequence-query;query_start=dtml-next-sequence-start-number;

This does not seem to be exactly the same fix as described in: 
http://www.zope.org/Collectors/Zope/1812


Should I have this problem in Zope 2.7.5-1.fc3?


2)

ValueError: invalid literal for int(): 0-  
When trying to do a select * 

this is definitely connected to the timestamp  column, because this change 
fixed it:


diff /usr/lib/zope/lib/python/Products/ZMySQLDA/db.py 
/usr/lib/zope/lib/python/Products/ZMySQLDA/db.py~
173d172
 conv[FIELD_TYPE.TIMESTAMP] = DateTime_or_None

I have found no mention of this anywhere?
Have anyone else had this problem
Comments?

Regards

Gaute Amundsen

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce

 http://mail.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Download Large Files in Zope

2007-03-07 Thread Tino Wildenhain

Jary Busato schrieb:

Maciej Wisniowski ha scritto:

Large files aren't store in ZODB but in a shared folder connected with
LOCALFS. Maybe Zope load a file in zodb before begin the download?
(Are there other storage product that work only in zope - without plone?)
Tramline is an Apache add-on but my problem still remain without
Apache so this product can help me after  I resolved the Zope issue.


I think that if you'll use tramline you'll have no 'Zope issue' anymore.

  

Looking LocalFS specs I find the issue:

This version of LocalFS takes advantanges of Zope 2.7.1 
http://www.zope.org/Members/hewei/zoperpms/zope2.7 's new 
/filestream_iterator/ feature and is believed to server large files 
better than before. However, my initial testing showed that *it still 
doesn't prevent the whole file being loaded into memory*. When I opened 
a URL pointing to a mpg file served by LocalFS, the file was loaded into 
memory and then immediately freeed twice.


I think that's the problem... load 300Mb into memory Maybe I look 
for other fs products.


However download of files off ZODB isnt such a big problem (you should
mount an extra storage for the files to avoid overly cache trashing)
but the performance is more then acceptable. ZODB/Filestorage is currely 
only a problem if you regulary update those files (or objects anyway)

because it would add a complete new version.

Regards
Tino Wildenhain
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] datetime format

2007-03-05 Thread Tino Wildenhain

Andreas Jung schrieb:



...

And I would not
use it much because you loose all type information and the
ability to sort accordingly and calculate with the values.

Better format them just for output - which would be in
python code.



It depends on the usecase..if you don't have to deal with different
date format it is handy to convert it on the RDBMS level..otherwise
you have to write something like

span tal:content=python: row.mydate.strftime(fmtstring) /



No, you would do that in your formatter class or at least in
the python script preparing the values for the template.

Regards
Tino :-)
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] datetime format

2007-03-04 Thread Tino Wildenhain

Garry Saddington schrieb:
I have 'datetime-format international' set in zope.conf but the date output is 
still rendered in the format (y,m,d) when using ZopeTime or when returning 
dates from python scripts. How can I change this behaviour? My server config 
is:


Well what you see is not the date but one representation of the
DateTime object. You can use the strftime() method to render your
date object to string in any form you want. This should also
answer your question on postgres list. Your database adaptor
turns database types into zope types.

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How to export ZWiki contents in ZODB to MYSQL

2007-02-26 Thread Tino Wildenhain

Win Myint Aung schrieb:

Dear Members,
 
I am a newbie in Zope. please do me a favor. I am looking for some 
python scripts that can export Zwiki contents from ZODB to MYSQL.


Well, the script is easy in principle but you need to know how
the result in your MySQL should look like. So its basically
just traversing the object tree in zope, lookup the properties
and attributes with content and then rewrite them in the form
your application needs it.

Otoh, its a lot of work - what is the expected gain?

Regards
T.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] frameset problems

2007-02-21 Thread Tino Wildenhain

Garry Saddington schrieb:

I have this page:

frameset rows=75%,25%
frame src=dtml-var page

frame src=dtml-call expr=getproperty(page=_['page'])

/frameset

The 'page' variable is in the request but no matter what I try I am having 
problems passing it the the python script 'getproperty'. Can anyone point me 
in the correct direction?


dtml-call? wtf! This will never ever work since dtml-call does not
return values. You might want to use dtml-var instead.

(Let alone you should try to not use dtml at all)

You above example would also not work since _['page']
would read a variable named page from _ namespace,
which would try to look up properties first and
only as last resort look for request variables.
There is REQUEST even in DTML.

Also note, design has long since moved away from frames
(Yes I know ZMI still uses them) - it makes things with
application servers much more easy if you don't use frames.

Easiest way is to return rendered pages from python script
for example


pagename=context.getProperty('page','defaultpage')

return context[pagename]()


as a python script would do the trick.

Regards
Tino


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] emulate a sequence

2007-02-08 Thread Tino Wildenhain

Jonathan schrieb:


- Original Message - From: Yuri [EMAIL PROTECTED]
To: zope@zope.org
Sent: Thursday, February 08, 2007 9:09 AM
Subject: [Zope] emulate a sequence


I need a field in zope object which act as a sequence. I mean every 
time I create an object, the value is the previous sequence value of 
the last object created + 1.


also I need to browse the objects by sequence (from the object 1 to 
the last, by the sequence number)


I think I need a catalog FieldIndex to store the sequence for 
searches, a property in the object.


Can I use the catalog to retrieve the max value of the index, so when 
I create the object, I just add 1 and store it in the property?


You could use a catalog if you have other searching requirements, but 
the method objectIds() (see the zopebook for more info) will return a 
list of contained Ids, which you can then sort to get you what you 
need.  Also, len(somefolder.objectIds()) will give you the next 
available id (assuming your object ids have some sequential numbering).


Which both would not exacly emulate a sequence. Sequences live outside
transaction borders so they are inremented every time under any 
circumstances.


All the above methods would fall flat on the tummy when you are hit with 
variuos rollback or retries while other transactions concurrently add 
objects.


Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZSQL Methods and transaction control

2007-01-10 Thread Tino Wildenhain

robert rottermann schrieb:

Hi there,

I am implementing a tool to handle userdata that is stored in a MySQL db.
The underlaying logic of the stored procedures used to maintain the db
content
dictate that I have to control the transactions myself.


Can you elaborate on that? I dont see a reason why you would
commit around zopes transaction handling (which would actually
be dangerous anyway - think of the retry mechanism in case of
database conflicts)


I understand that there is a way to handle transaction controll in the
ZMySQL
methods. However I find no documentation at all on how to use it.


Well most databases accept COMMIT as sql command.


Without using ZMySQL methods I would be using the following piece of code:
db = mysql.connect(host=localhost ...)
cursor = db.cursor()
query = CALL insertUser('%s', '$xxx$', @id, @error);select @id, @error
% 'JohnTheUser'
cursor.execute(query)
# get the next resultset, it has the result of the select
cursor.nextset()
result = cursor.fetchall()[0]
error = int(result[1])
if error:
print error %s when trying to add user %s % (ERRRORS[error],
'JohnTheUser')
db.rollback()
continue #we are in a loop actually


what does the loop?

..
db.commit()
How can I mimic that using ZSQL Methods


Are you adding users in a series? What exactly
are you doing? If its kind of migation, consider
running it as a script with zopectl run migationscript.py
once. There you could just write python code as you like
w/o interfering w/ Zopes session handling.

Regards
Tino

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Recovering from Data.fs

2007-01-09 Thread Tino Wildenhain

Maciej Wisniowski schrieb:

From my understanding the paths for the zope instance have to be the
same for Data.fs to work correctly. Is that correct?

No, Data.fs should be portable.


Yup, need to crete plain new Zope instance and put
your data.fs into var directory. After this start Zope
and take a look into ControlPanel-ProductManagement to
see if you have broken (or not installed at all) products.
You might also lack external methods from Extensions/ folder.

Of course you need to know user and password to log into ZMI.
You may create new one in zopectl with useradd (or adduser I don't
remember) command.


Needless to say you should keep an original copy of your
Data.fs on a safe place while you do the above tests.

You should be save, but you never know :-)

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-dev] [ZPT/Zope 2.10] Unicode fixes backported

2006-12-28 Thread Tino Wildenhain

Andreas Jung schrieb:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

as mentioned in an earlier I was working on several encoding and webdav
issues related to the Zope 3 ZPT integration in Zope 2.10. I backported
the changes to the 2.10 branch.

The changes include an in-place migration of all ZopePageTemplate instances 
to unicode (through a custom __setstate__() implemenetation). The migration 
code tries to sniff the encoding (it knows about ISO-8859-15 and UTF-8). A 
custom preferred encoding can be specified through the environment 
variable $ZPT_PREFERRED_ENCODING.


You should rather use config param default-zpublisher-encoding as a 
default, maybe with a fallback to (hopefully once obsolete)

MANAGE_PAGE_CHARSET property.


I know that this migration is a big hammer (for a minor release) however I 
have not found another solution to deal with the outstanding issues in a 
reasonable and sane way. Therefore this migration must be tested. I am 
thinking about a beta release for 2.10.2 in order to get the stuff tested

(I am also aware of the fact that most people don't test betas :-))


The sniffing could work however. Maybe we should have some warnings
printed on console during zope start? Or even a configureme parameter
which stopps zopes start when there is a non empty storage to migrate?

Regards
Tino
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope] tal loop to render table

2006-11-29 Thread Tino Wildenhain

Dennis Schulz schrieb:
I would like to build a tal loop that renders a list of elements 
(widgets in my case) in a table.
(for example I have a list of 9 items, then it renders a table: five 
rows with 2,2,2,2,1 items)
the table has 2 columns, so i would need to open and close the table row 
every second item.
I tried to check with a condition if the row is odd or even, but 
unopened and unclosed tags are not valid.


Is there any possibiliy to do this with tal?


Well, you just dont want to do this in TAL, really ;)
You have to choices: either not using a table but
a couple of carefully CSS-crafted div tags
(See alistapart.com or so for hints on tableless floating
designs)

Or you go the easy path and have a data preparing script
(Script (Python) - Object) which does something along the lines
of:

data=your_nine_items

rowlength=2

return [data[i:i+rowlength] for i in range(0,len(data),rowlength)]


I think you get the idea :-)

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] tal loop to render table

2006-11-29 Thread Tino Wildenhain

Tino Wildenhain schrieb:

Dennis Schulz schrieb:
I would like to build a tal loop that renders a list of elements 
(widgets in my case) in a table.
(for example I have a list of 9 items, then it renders a table: five 
rows with 2,2,2,2,1 items)
the table has 2 columns, so i would need to open and close the table 
row every second item.
I tried to check with a condition if the row is odd or even, but 
unopened and unclosed tags are not valid.


Is there any possibiliy to do this with tal?


Well, you just dont want to do this in TAL, really ;)
You have to choices: either not using a table but

two


a couple of carefully CSS-crafted div tags
(See alistapart.com or so for hints on tableless floating
designs)

Or you go the easy path and have a data preparing script
(Script (Python) - Object) which does something along the lines
of:

data=your_nine_items

rowlength=2

return [data[i:i+rowlength] for i in range(0,len(data),rowlength)]


I think you get the idea :-)


ah yes, and I forgot the TAL:

table ..
 thead ...  /
 tbody
   tr tal:repeat=row here/thescript or options/prepareddata
 td tal:repeat=col row tal:content=col123/td
   /tr
 /tbody
/table


I guess you know what values you really want to put in :-)

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-dev] Cache code in Shared/DC/ZRDB/DA.py

2006-11-17 Thread Tino Wildenhain

Chris Withers schrieb:

Tino Wildenhain wrote:

I have a replacement started, which uses Cacheable mixin instead.
Advantage is, with RAM Cache Manager you can see the hits your method
cause and invalide the cache per object. I also introduced a execution
time treshold, so you can configure to only cache runtimes say above
1 sec, leaving more room for long running queries.

I think I should packe up what I have now (rough edges) so you
can have a look at it.


I have to be honest, I'm looking to simplify, and this sounds a LOT more 
complicated...


No actually it isnt. I ripped out a lot of the old code. All other stuff
is easily handled by the cache code anyway.

ZSQL Methods and all that stuff is horribly old and full of calamities.
Apart from the cache management nightmare, there is also a lot of
ZMI stuff really wrong. You dont see the right encoding because
the test pages ignore it, you have a pretty formatter for
column names - hiding their real name and you always have to wonder
the name of the variable you get in the result set.

(fOO_bar becomes FOO bar for example)

and so on :-)

I think I just upload what I have so you can have
a look at it :-)

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Cache code in Shared/DC/ZRDB/DA.py

2006-11-17 Thread Tino Wildenhain

Chris Withers schrieb:

Tino Wildenhain wrote:

I have a replacement started, which uses Cacheable mixin instead.
Advantage is, with RAM Cache Manager you can see the hits your method
cause and invalide the cache per object. I also introduced a execution
time treshold, so you can configure to only cache runtimes say above
1 sec, leaving more room for long running queries.

I think I should packe up what I have now (rough edges) so you
can have a look at it.


I have to be honest, I'm looking to simplify, and this sounds a LOT more 
complicated...


And here it is (maybe it takes a couple of minutes to be visible)

http://www.zope.org/Members/tino/CachedZSQLMethods

http://www.zope.org/Members/tino/CachedZSQLMethods/CachedZSQLMethodsPrerelease/CachedZSQLMethods_0.1_alpha.tgz

Greets
Tino
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Cache code in Shared/DC/ZRDB/DA.py

2006-11-17 Thread Tino Wildenhain

Chris Withers schrieb:

Chris Withers wrote:


I have to be honest, I'm looking to simplify, and this sounds a LOT 
more complicated...


Okay, I've written unit tests and refactored the code on the 2.9 branch, 
2.10 branch and trunk.


Please let me know if you have any problems...


Uh oh - which code? :-)

Greets
Tino
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Cache code in Shared/DC/ZRDB/DA.py

2006-11-16 Thread Tino Wildenhain

Chris Withers schrieb:

Hi Jim,

I'm wondering if you can still remember the rational behind the cache 
code at around lines 355-387 of:


http://svn.zope.org/Zope/trunk/lib/python/Shared/DC/ZRDB/DA.py?rev=68158view=auto 



This code is pretty old (checked in 5th Dec 1997) but has started 
causing a few people problems under high load:


http://mail.zope.org/pipermail/zope-db/2006-September/004684.html
http://www.zope.org/Collectors/Zope/2212

In particular:

- in line 368, why is len(cache)max_cache/2 used as a trigger to start 
cache clearing? (the /2 in particular)


- does it matter that IOBTree.Bucket has gone away and that tcache is
  now a simple dictionary? It certainly seems to make the keys.reverse()
  on line 370 superfluous and the keys[-1]t on line 371 less reliable.

More generally, do you or does anyone else have any attachment to this 
code or would anyone mind if I ripped it out and replaced it with 
something simpler, with more comments and unit tests?


I have a replacement started, which uses Cacheable mixin instead.
Advantage is, with RAM Cache Manager you can see the hits your method
cause and invalide the cache per object. I also introduced a execution
time treshold, so you can configure to only cache runtimes say above
1 sec, leaving more room for long running queries.

I think I should packe up what I have now (rough edges) so you
can have a look at it.

Tino.
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope] Z2.log format

2006-11-16 Thread Tino Wildenhain

Sascha Adler schrieb:
I'm running an instance of Zope 2.8.6, and I'm stumbling into a problem 
with the format of Z2.log. Unlike an Apache log, which would have the format


%S - %u ...


Well the apache log format is configurable. I don't know why the
analysis products stuck with the weird default.


Z2.log appears to have the format

%S- %u ...

The lack of the space following %S causes analog to choke on an address 
that contains a hyphen in it, and in my case, analog cannot read half of 
Z2.log. I've tried looking up how to change the format Z2.log comes in, 
but I haven't found anything useful. Is there any way to work around this?


Usually you work around this by placing apache as frontend to zope -
which makes a log things easy (simple balancing, switching, virtual
hosting, ssl, ...  to name just a few) and last not least configurable
logging. You can completely disable Z2.log.

For no good reason, many log analyzer do not look on mime-information
of the request but try to find out by inspecting the suffix of the url,
thy of course als don't know that /foo and /foo/ in zope really means
the same thing and so on. Sane log analysis makes a good deal of work
I can tell you.

Good luck
T.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] matplotlib and zope problem

2006-11-14 Thread Tino Wildenhain

Marek Szczypiński schrieb:

Hello All,

  I've been using zope and matplotlib for some time now, and I want to
connect them. I'am using the example code from page:
http://www.scipy.org/Cookbook/Matplotlib/Matplotlib_and_Zope ,
but whenever I try to import matplotlib, and/or pylab packages i get
this error from zope:

Error Type: RuntimeError
Error Value: '/' is not a writable dir; you must set environment
variable HOME to be a writable dir


*wild guess*

you are starting Zope as root (via init) so $HOME
points to root's home directory (usually /root)
Now zope switches to another user (configured or
default to nouser and thus cannot write to
root's home anymore.

You can either set another value for $HOME in your
zope.cfg - there is a section for custom environment
vars or modify mathplotlib to _not_ write to $HOME.

(Sounds like a bad idea anyway - whats wrong with temp?)

Zope Products use ZOPEHOME and INSTANCE_HOME

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How to create a new TAL statement?

2006-10-28 Thread Tino Wildenhain

Garito schrieb:

Tino Wildenhain escribió:

...
I'm talking about tal:anything tal:yanged=/foo/bar / not tal:yanged 
tal:replace=/foo/bar /


What I need is control the expression far away from the normal way (I 
want to process the result automatically before return the result)


Aj and Chris dissapoint me to modify the __gettattr__ member of my class 
to make this calculation


Then I thing I can make this calculation via some tal:statement

Some idea?


Err, what they didnt tell you, its easier to implement get()
on your method (item access) just like dictionaries.

This can be used w/ tal path expressions as well.

No need to fiddle around with extending TAL.

Regards
Tino Wildenhain
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How to create a new TAL statement?

2006-10-27 Thread Tino Wildenhain

Garito schrieb:

Hi all!

As Aj and Chris advise my to forget the __getattr__ bussiness I try to 
solve the same question by other ways


Now I have a new question:

Can you point me to some help about how to create a new TAL statement?

I would like to create a tal:yanged (for example) statement to control 


tal:yanged replace=/foo/bar /

would work :-) But what are you really trying to do and why?

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZSQL Method's Precision

2006-10-24 Thread Tino Wildenhain

Maciej Wisniowski schrieb:



In a PostgreSQL DB I have a Numeric data type with a precision of two
decimal places. If I have 1.33 in as the result from my query, it's
everything is good. However, if I have 1.30 it reduces the precision
to one decimal place and I get 1.3. Not so good when dealing with
currency ( I don't want to use the money data dype ).

Any ideas on how I can get my ZSQL method to keep two decimal places?

As others said it's a matter of displaying. You say that you don't want
to use money datatype but keep in mind that postgre adapter
is able to use Python's Decimal datatype for money values (in python2.3
you need additional module decimal.py from Python 2.4 to enable it)
which may give you necessary precision for financial operations and is
able to store really big numbers.


The adaptor should use it for numeric data as well (hey, hence the name 
;) Use of the deprecated money datatype in postgres isnt recommended.

(And its superceeded by numeric anyway)

Regards
Tino Wildenhain

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] DTML Call Fails

2006-10-24 Thread Tino Wildenhain

[EMAIL PROTECTED] schrieb:

A little bit of legacy DTML fun here... Zope 2.9.3

On save of a DTML Method, why would this dtml-call fail:

dtml-let standards=REQUEST.SESSION
  dtml-call standards.set('AR-DA-08', AR-DA-08)
/dtml-let

With the error: 


Expression (Python) Syntax error: invalid token

Whereas this works fine:

dtml-let standards=REQUEST.SESSION
  dtml-call standards.set('AR-DA-07', AR-DA-07)
/dtml-let


I doubt any of that really works. So you happen
to have the variables named AR and DA defined
as numerical values somewhere? Otherwise the expression
makes no sense at all. The leading 0 in 08 and 07 indicates
you might have a completely other illusion on what's going on.

Any reason you cannot write in a python script something like:

REQUEST.SESSION.set('some_resonable_named_variable','AR-DA-07') ?

Could you explain in plain english what your final goal
of your construction is?

Regards
Tino Wildenhain
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] DTML Call Fails

2006-10-24 Thread Tino Wildenhain

[EMAIL PROTECTED] schrieb:
Hi Tino.  Yes, that is correct. This application has variables named 
like:


'AR-DA-08'


Not very clever.


This also fails in a Page Template:

span tal:define=standards python: request.SESSION
   tal:block define=temp python: data.set('AR-DA-08',AR-DA-
08)/tal:block


you still have to quote if you mean the variable with that
weird name. Otherwise its an expression in python.

_['AR-DA-08'] could work in DTML... but lets better forget
that ;) Where does your variable live? In Request maybe?


/span

With the error:

Compilation failed
TAL.TALDefs.TALError: Python expression error:
invalid token (Python expression data.set('AR-DA-08',AR-DA-08), 
line 1) in expression python: data.set('AR


TAL??



Yet this works:

span tal:define=standards python: request.SESSION
   tal:block define=temp python: data.set('AR-DA-07',AR-DA-
07)/tal:block
/span

So you are saying the interpreter is seeing the '-' as a minus? Why 
would it work in one case and not the other?


See Andrew's note on ocal numbers.



Could the minus be escaped somehow?


No, but see above.

Could you please escape the horribly code + template
mixing with DTML? ;) See the zope book for python scripts.
(After all in DTML expressions its already python code,
so why not write just python code and skip all that
foo stuff around it you dont need anyway?

Regards
Tino Wildenhain
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] DTML Call Fails

2006-10-24 Thread Tino Wildenhain

[EMAIL PROTECTED] schrieb:
Changing the dash to an underscore in the variable name solved the 
problem.


I'm quite sure you could solve it even better - if we would know
where these variables come from and what their meaning is.

I suspect some kind of form?

Regards
Tino Wildenhain
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] [Fwd: [USN-359-1] Python vulnerability]

2006-10-06 Thread Tino Wildenhain

Chris Withers schrieb:

ouch... I'd imagine Zope is vulnerable to this?

What source version(s) of python have these problems fixed?


Well debian also had it already. I'd guess current sources
should have it too. Watch changes.txt and friends.

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Log in as another user

2006-10-02 Thread Tino Wildenhain

Sinang, Danny schrieb:

Hello,
 
In Unix, there's the su command which admins can use to log in as 
another user.
 
Is there a similar facility in Zope ?


not as login but there are the proxy roles you can assign to
an object (script) to do something with raised privs.
 
If not, is there a way for admins to view the passwords of their users ?


Usually no. (most sane userfolders hash the passwords and dont store
them clear text)

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Calling a Script from ZPT

2006-09-18 Thread Tino Wildenhain



--On Montag, 18. September 2006 06:43 -0700 Ferhat Ayaz 
[EMAIL PROTECTED] wrote:



Hi,

a quick and newbie question:

How can I call a Script (Python) within a page
template. I'm using the 'define' tag:

tal:contain
 define=no_matter_var
python:context.mycall(myParam)/

Is there a more serious way to do this?


Yes, don't do it :-)

PageTemplates are views and as such not
supposed to have sideeffects on application.

I'd do it in the application code instead,
e.g. before the pagetemplate is called.

(Yes you can return the result of a call to
a pagetemplate from a python script if you
want it easy :-)

e.g. python script:

doseomething ...

return context.thepagetemplate(arg1=var1, ...)


Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-dev] Serving large files

2006-09-17 Thread Tino Wildenhain

Sidnei da Silva schrieb:

I remember having a conversation with Jim at some point where he
proposed a strategy for requests that could potentially take a long
time to finish. If I recall correctly, he proposed having a separate
ZODB connection pool.

One thing that is problematic today is serving large files
from the ZODB (ignoring the upcoming blob support).

a) You can't return an iterator that reads from the ZODB, because by
   the time the iterator is consumed the connection has already been
   closed. I believe the iterator is not consumed in the same thread,
   which can cause yet more issues.

...


I would like to be able to return an iterator that can read from the
ZODB. That would probably benefit the WSGI integration as well. Anyone
has ideas about how to solve this?



It should be possible to feed a fifo (at least on unix) and reopen the
connection each time via publisher or something alike (similar to the
retry mechanism on database conflicts) and fill the buffer again.

Regards
Tino
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope] \n problems with mysql5

2006-09-15 Thread Tino Wildenhain



--On Freitag, 15. September 2006 01:08 -0700 Ferhat Ayaz 
[EMAIL PROTECTED] wrote:




Hi,
sorry list. The problem was the changed syntax of JOIN
between mysql 4 and 5.

SELECT bla FROM bla INNER JOIN table1,table2 ON ( bla
)

must be changed to

SELECT bla FROM bla INNER JOIN (table1,table2) ON (
bla )


Crazy syntax.
What about SELECT bla FROM table1 JOIN table2 USING bla ?

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] DTML - ZPT

2006-08-31 Thread Tino Wildenhain
Antonio Beamud Montero wrote:
 Is this the equivalence?
 
 dtml-var day fmt=%02i
 
 td tal:replace=python:'%02i'%item['day']
 
 or exists other way?
 

Yes, you format your output in a (possibly
locales dependant) intermediate layer between
your application and your template.

In the easiest implementation it is a
python script which queries the original
item list and outputs a formattet item list
you use directly w/ path expressions only.

This way you can centrally control and
switch your formatting w/o touching the
templates anymore.

Regards
Tino Wildenhain
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] python expression in tal:attributes

2006-08-30 Thread Tino Wildenhain



--On Mittwoch, 30. August 2006 04:32 -0700 Ferhat Ayaz 
[EMAIL PROTECTED] wrote:




yes, you're right. With define it works. Below is the
same code with define. Thank you.
But now I have another problem (actually my main
problem). For instance,if you click more and more on
the link 'Catalog'. The URL grows up like
http://localhost:8080/Site/Catalog/Catalog/Catalog//index.html
How can I say that the Catalog folder is just under
the Site folder?

   ul
li tal:define=links python:{
'Catalog/index.html':'Catalog',
'Users/index.html':'Users',
'Orders/index.html':'Orders'}
tal:repeat=item links/items
a href=
tal:define=link python:item[0]
tal:attributes=href
string:${container/absolute_url}/${link}
tal:content=python:item[1]link name/a
/li
   /ul


Why don't you better use python script to prepare your search
and results and use its return value (usually prepacked, preformattet
data in lists and dictionaries) instead?

Links to index.html are also extremly ugly. Why not just link
to the container?

Regards
Tino Wildenhain 
___

Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-dev] PAS-1.4-final Released

2006-08-28 Thread Tino Wildenhain
Andreas Jung wrote:
 
...
   I'm pleased to announce that the final 1.4 version of the Zope
   PluggableAuthenticationService product is now available at:

 
 *me loud thinking*: wouldn't it make sense to integrate PAS into the
 Zope 2 core and make it the new default mechanism for authentication
 replacing
 the old crappy UserFolder stuff?

Would be nice - otoh, its still very rough - its actually not
understandable how to plug which elements together to achieve
a given goal. There is some documentation text about the
general usage in the archive but if you dont have something
online I'd expect a lot of people getting really confused
and locking them out theirself. So unless you read what to
do at the ZMI level, I'm a bit -1 for default integration.

Tino
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope] autorefresh a web page every x minutes

2006-08-04 Thread Tino Wildenhain
Andreas Jung wrote:
 
 
 --On 4. August 2006 15:32:26 +0100 Alan [EMAIL PROTECTED] wrote:
 
 Dears,

 Is there a way of doing a particular page template (ZPT) keeping
 reloading/refreshing itself every x minute?

 I hope so. Any help would be very appreciate. Many thinks in advance.


 
 This is not a Zope question. Google for meta refresh tag.

or google for real headers :-)

context.REQUEST.RESPONSE.setHeader('refresh','60')

for example.

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] how to use chinese character in zope 2.8.7

2006-07-29 Thread Tino Wildenhain
Chris Withers wrote:
 Mark Barratt wrote:
 2: In the root of the Zope Management Interface, choose the properties
 tab. In it, add a new property called MANAGEMENT_PAGE_CHARSET of type
 'string' with value utf-8.
 
 Actually, for hysterical raisins, this needs to be UTF-8 rather than
 utf-8 in order for the unicode property types to make themselves apparent.
 
 Aside from this, use unicode for everything...


Btw, still waiting for comments, thumbs down/up for:

http://www.zope.org/Collectors/Zope/2148

cheers
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Script execute with every request

2006-07-24 Thread Tino Wildenhain

Joshua Burvill wrote:

Hi,

 

I’d like to log certain parts of each request into a database table for 
every request to provide an audit trail.


 

I thought of inserting a dtml-call  xxx into the standard_html_header, 
but when there is a RESPONSE.redirect, it will not be the original 
request that gets logged.



Well that would mean 2 log entries - one from the redirecting
page and one from the target of the redirect.

Btw, its usually not the best idea if you can avoid it -
what about using the apache log facilities here?




Can anyone offer any suggestions?

 


Thanks, Josh


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.1/391 - Release Date: 18/07/2006


 Ah, wasting cpu cycles for nothing :-)


Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-22 Thread Tino Wildenhain
Stefan H. Holek wrote:

 On 21. Jul 2006, at 16:53, Chris Withers wrote:
 
 I wonder how Zope 3's filesystem-based ZPT's deal with this?
 

 zope.pagetemplate.pagetemplatefile.PageTemplateFile reads an eventual
 meta http-equiv=Content-Type ... header, or defaults to UTF-8.

Well, pagetemplate files are another thing. They have to deal with
the lack of charset information of a filesystem file and what they
do once they load the data is even another thing.

Even filesystem pagetemplates should work with unicode internal,
making it easy to recode them for output and combine with other
potentially unicode stuff.

Tino
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-22 Thread Tino Wildenhain

Andreas Jung schrieb:




--On 22. Juli 2006 15:34:01 +0200 Tino Wildenhain [EMAIL PROTECTED] 
wrote:



Well, pagetemplate files are another thing. They have to deal with
the lack of charset information of a filesystem file and what they
do once they load the data is even another thing.

Even filesystem pagetemplates should work with unicode internal,
making it easy to recode them for output and combine with other
potentially unicode stuff.




huh?..even on the file system a pt file is encoded using some encoding.
For an XML pagetemplate file the encoding is clearly defined through 
the BOM (if available) and/or the XML preamble. So the most reliable 
solution would be to use XML PTs only.


Yes but you have to explicitely store that information somehow in the
file - zope objects can use other methods to transfer encoding information
while they create the internal representation.
meta-tags for charset are quite ugly but you basically have no other
choice with filesystem stuff.
Problem here if the various encoding notifications collide (XML header 
vs. XHTML meta-tag vs. BOM) so better have as few as possible - even 
better none when

we deal with HTTP-Servers which can nicely handle this all out of band
and on demand.

webdav or put can send charset data, zmi would use 
default-zpublisher-encoding

etc. If you store the internal object in unicode you can safely combine
different souces of encoded data instead of having a weird mesh of
decoding and encoding going on.

So I would not care how to find out about the intended encoding - once the
object is instantiated.

Regards
Tino
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-22 Thread Tino Wildenhain
Andreas Jung wrote:
 
 
 --On 22. Juli 2006 16:17:09 +0200 Tino Wildenhain [EMAIL PROTECTED]
 wrote:
 huh?..even on the file system a pt file is encoded using some encoding.
 For an XML pagetemplate file the encoding is clearly defined through
 the BOM (if available) and/or the XML preamble. So the most reliable
 solution would be to use XML PTs only.

 Yes but you have to explicitely store that information somehow in the
 file - zope objects can use other methods to transfer encoding
 information
 while they create the internal representation.
 meta-tags for charset are quite ugly but you basically have no other
 choice with filesystem stuff.
 Problem here if the various encoding notifications collide (XML header
 vs. XHTML meta-tag vs. BOM) so better have as few as possible - even
 better none when
 
 I am only talking of XML. And the encoding is clearly and unambiguously
 defined through the BOM (if available) and the XML preamble. So any

Pardon, thats nonsense. BOM means byte oder mark and not encoding mark
(It would read EM instead, wouldnt it? ;) Its only used with some 16 bit
encodings to tell the byte order of the two bytes (obviously).
And XML only via its XML preambel, which is just another place to put
encoding information in band. (In fact we should have publishing engine
to fix this preamble as well as the infamous meta-tag (if available)
to reflect the encoding currently in use.


 application reading an XML file is able to detect the encoding and produce
 a unicode string from the file. According to a discussion with Dieter

Yes, and in case of the filesystempagetemplates and friends, the
template is that application which reads and should produce the unicode
string.


Regards
Tino
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope] Catalog aware

2006-07-20 Thread Tino Wildenhain

Garito wrote:

Tino Wildenhain escribió:

Garito wrote:
 

Tino Wildenhain escribió:
   

Garito wrote:
...
 
 
Sure, but I can't create a new product for every product I'll use 
only

to do it catalog aware, isn't it?


Yes you can. Why not? I mean you are using them - so you can use
your products instead as well.
  

Yes but what if tomorrow you create a product? need work to times: you
first, me later


Who says you have a use for the product I create? Or if it makes
sense to catalog it? If you want a cataloguing framework, why
dont you use CMF or something?


I want to make every class catalogable only if I point a zcatalog id
(with self.default_catalog) but If I point it I want to catalogue the
object



And what of the object do you want to catalog?
Which kind of indexes do you want it to support?
What kind of questions do you expect your ZCatalog
(hypothetically) answered? Could you give examples?
  
Is not important what I want to catalog, for me is important that the 
object *was* in the catalog (some catalogs indexes some properties some 
others other properties)


Please read the catalog section again: there isnt the object in the catalog!
Again: The object is _not_ in the catalog.
Its all about usefull indexes and maybe object metadata.
So again: _what_ actually do you expect to find?



 

Now is a search era, isn't it?



Yes, search for what and by whom is the question here.
  

I don't thing so. The question is who is in the catalog
 

Use another framework only to do the objects catalogable?

I love simple things



So why are you trying to make standard zope objects more
complicated? :)
  
More complicated? Sure, but I don't understand the cost to make every 
object in Zope catalogable. A class and a variable I don't thing is a 
big cost

And I thing in Zope when I thing in keep it simple


Yes, but its nonsense. You cant do anything more with the objects
in Zope if they are catalogued.


 
 
In my opinion (is only an opinion) these is not the best situation 
in a

future

Sorry but is not so acceptable for me


The point is, it makes no sense to catalog Pagetemplates,
Python Scripts, Folders and ZSQL Methods, Mailhosts
and Database connections. These are all standard zope
objects, yet they make catalogable content only in derived
work or when they play together - which is a custom
solution anyway. There you can add whatever cataloguing
awareness you want.


And if I use them dinamically (a user with the role1 use the template
Ver but a user with the role2 use the template Ver1 for the same
context)? (I'm not sure if I understand you clear, sorry If I make a
mistake, please



This would not be supported by just adding indexing to the standard
objects anyway. You would write a container which supports the bahavior
you want - and while you are at it you can easily add catalogawareness
to that - exactly where and in the way _you_ need it :-)
Individual objects cataloguing themself would get in your way.

Regards
Tino Wildenhain
  
Yes, I'm creating a specific container that works in a curious way. In 
that container I could catalog a Page Template when I'm adding it but 
perhaps sometimes I want to track its changes an so on



Yes, but who should know what _you_ want your objects to do? You cannot
expect all people (especially the ones writing zope core) to guess
your needs - you are the one to express your wishes in the form of
code :-) If you end up having a general solution (like these frameworks
are) you can share them with others.

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Catalog aware

2006-07-20 Thread Tino Wildenhain

Garito wrote:

Tino Wildenhain escribió:

Garito wrote:

Tino Wildenhain escribió:

Garito wrote:
 

Tino Wildenhain escribió:
 

Garito wrote:
...
 
   
Sure, but I can't create a new product for every product I'll 
use only

to do it catalog aware, isn't it?


Yes you can. Why not? I mean you are using them - so you can use
your products instead as well.
  
Yes but what if tomorrow you create a product? need work to 
times: you

first, me later


Who says you have a use for the product I create? Or if it makes
sense to catalog it? If you want a cataloguing framework, why
dont you use CMF or something?


I want to make every class catalogable only if I point a zcatalog id
(with self.default_catalog) but If I point it I want to catalogue the
object



And what of the object do you want to catalog?
Which kind of indexes do you want it to support?
What kind of questions do you expect your ZCatalog
(hypothetically) answered? Could you give examples?
  
Is not important what I want to catalog, for me is important that the 
object *was* in the catalog (some catalogs indexes some properties 
some others other properties)


Please read the catalog section again: there isnt the object in the 
catalog!

Again: The object is _not_ in the catalog.
Its all about usefull indexes and maybe object metadata.
So again: _what_ actually do you expect to find?

When I talk about was in the catalog I mean the object is catalogued
I expect to find *the object* in the catalog

For example:

How do you know how many cousins you have? Because you are a catalog 
that catalog the number of cousins you have


So you want to count objects based on their meta_type?
Of what use would be such an information?
What if you know how many pagetemplates you have? :-)

Another example: how much skills about computing do you have? Again your 
skills are objects that you need (as a catalog you are) to catalog


We have a skills object in plain zope now? Thats news for me.

Like an entity (a thing, and object) you need to know some data stored 
in your life added to you


Yes, but a zcatalog cannot work with some data - you need to specify
exactly _which_ data you want to find. So what exacly is this on
standard Zope objects?
..


Yes, but its nonsense. You cant do anything more with the objects
in Zope if they are catalogued.
Are you sure? I can find them!!! Then if I can find them I can count 
them, give to you (even if its don't depend on me, remember your skills 
or your cousins?)


Ah yes, which zope product stores cousin data?



I want to create an object that acts like an entity (like a human or a 
mortage or a paper or a product -that you can sell)


Yes, you crate it - you define its cataloguing. So what is your business
with standard zope objects here?


These entity need to know how is it (its properties, its characteristics)


You cant barely catalog all properties - the catalog would not even know
if this property is meant as keyword or fulltext or whatever...

I ask myself if I know myself but I only know about myself all I can 
catalogue

...


Regards
Tino
I don't expect anyone guess my needs (is for that I need to develop the 
class) :)
I only ask if I can add some super classes to an object when  I create 
it :)


You can, you just add it. Its there and you even know its name.
So what was your problem again? :-)

I know my needs are so particular but I want to create something new 
with a new perspective. If I can the result will be very curious (I 
suppose, I expect even)


I choose Zope because is the most near to my finall result


Exactly :-)

Regards
TIno
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [***SPAM*** Score/Req: 04.00/04.00] Re: [Zope] Catalog aware

2006-07-20 Thread Tino Wildenhain

Garito wrote:

Martijn Pieters escribió:

Please don't email me personally; let's keep this discussion on the list.

Garito wrote:
 

Yes, the indexes depends on the entity (I don't know what indexes I use
until I define the entity but I need to catalog every characteristic of
the entity)

For example if I have a entity with a container where to put my cousins
information I will catalog a keyword index called (is an example,
remeber) HowMuch that counts the number of the objects stored in the
container

Or if I talk about skills I will catalogue the marks or the way to print
the certificate of excelence (again an example)



But then you can create specific subclasses that are catalog aware. What
standard objects would you use to implement this? You have a specific,
non-generic use-case that has already been catered for by the framework.
  
I can't subclass every class I need. These will need to reajust 
(subclass) every new case

For example:
Now I know I need Page Templates and Script Python catalogaware, then I 
subclass them and I finish the work, good


But tomorrow I need a Mail host catalogaware, begin again and create a 
subclass for Mail host


haha. I wonder which property of that single MailHost object you
probably use you want to catalog and what exactly would be your
Query to the ZCatalog, once you want to find out...

I would like if there are a generic way to add catalogawareness by code. 
If there are my problem about catalogawareness finish


Speaking of code: did you think about my hint? I mean the one with
the loop - if you have the weird notion you need to make anything
catalogaware, why dont you write a product which iterates over
all other products in zope, and if not catalogaware, generate
a generic catalogaware subclass for you?

Heaven, you could even half way finished by the tiem you feed the thread :-)

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] default webpage after External Method script executed

2006-07-20 Thread Tino Wildenhain
Andreas Jung wrote:
 
 
 --On 20. Juli 2006 19:25:11 +0100 Alan [EMAIL PROTECTED] wrote:
 
 Hi!

 My simple webpage for submitting files is ok. It calls a External
 Method script to do all the dirty job. However, I am running out of
 ideas of how to get back to my default submitting web page after
 submitting a file (and thus execute the script).

 
  return self.context.REQUEST.RESPONSE.redirect(some_url_plus_query_string)

valid but very ugly. Why not just return the result of the call of a
template?

e.g. return self.zpt_or_whatever_template()

Or do all the form work in a python script anyway, which calls
the external method when everything looks ok and returns
with the template as above.

While I wonder what the mentioned dirty work really is...

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


  1   2   3   4   5   6   >