[Zope] Passing arguments when calling precondition

Jánvári Gusztáv janvari.gusztav@chello.hu
Sun, 13 Jan 2002 00:35:55 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_0045_01C19BCA.42F5AB20
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Could anybody tell me a reliable method on how to pass arguments for a
script/method employed as precondition for some File objects?

What I'd like to do is to pass a record identifier to the method called as
precondition, increase a download counter in a database, then let the
visitor download the given file. If the record identifier would be None, an
exception could be thrown, thus denying access to the file. In this case I
wouldn't bother with users who try to enter absolute URL with a valid record
identifier known e.g. by accident for the files requiring registration
before downloading, since the download counter would work and that's all
what I want.

e-Musty

------=_NextPart_000_0045_01C19BCA.42F5AB20
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2712.300" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D573173023-12012002>Could =
anybody tell=20
me a reliable method on&nbsp;how to pass arguments for a script/method =
employed=20
as precondition for some File objects?</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D573173023-12012002></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D573173023-12012002>What =
I'd like to do=20
is to pass a record identifier to the&nbsp;method called as =
precondition,=20
increase a download counter in a database, then let the visitor download =
the=20
given file. If the record identifier would be None, an exception could =
be=20
thrown, thus denying access to the file. In this case I wouldn't bother =
with=20
users who try to enter absolute URL with a&nbsp;valid record identifier =
known=20
e.g. by accident&nbsp;for the files requiring registration before =
downloading,=20
since the download counter would work and that's all what I=20
want.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D573173023-12012002></SPAN></FONT>&nbsp;</DIV>
<DIV class=3DSection1><FONT face=3DArial size=3D2><SPAN=20
class=3D573173023-12012002>e-Musty</SPAN></FONT></DIV></BODY></HTML>

------=_NextPart_000_0045_01C19BCA.42F5AB20--