Re: [Zope-dev] ZCatalog uniqueValuesFor() cached?

2000-10-04 Thread Chris Withers

Stick it in the collector:

http://classic.zope.org:8080/Collector/

Chris

Brett Carter wrote:
 
 How can I update the uniqueValuesFor()?  Whenever I delete one of my
 ZCatalog-aware zclasses, they are still returned in uniqueValuesFor.
 What gives?  is this cached or something?
 -Brett
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )

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




[Zope-dev] Re: CoreSessionTracking proposal

2000-10-04 Thread gotcha

--- In [EMAIL PROTECTED], "Chris McDonough" [EMAIL PROTECTED] wrote:
 Without a client-checking scheme (such as encoding the IP 
address in the
 token), a token theft attack is very easy.  As voiced by 
others in the
 thread, client-checking is not reliable, should not be a 
default, and maybe
 shouldn't be included as an option at all.
 
I would like to control finely the session security mechanisms. 
I would like to be able to plug a client-checking (or anything 
else). This way, each WebApp developper can discriminate among 
its own constraints and risks. I want to be able to use 
different ways to secure the session. 

For example, ther would be cases where I would implement a 
client-checking mechanism based on both IP address and browser 
time-limited cookie. This would allow me to follow sessions on 
people refusing cookies and on people behind "IP dancing" 
proxies. I would loose session state for anyone both refusing 
browser cookie and being behind "IP dancing" proxy. This would 
be an acceptable compromise if I am manipulating highly private 
data.

In other cases, I could accept lower-level security related to 
the less privacy.


Godefroid Chapelle

-
BubbleNet sprl
rue Victor Horta 30
1348 Louvain-la-Neuve 
Belgium

-
This mail sent through SwinG Webmail: http://mail.swing.be 

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




Re: [Zope-dev] (no subject)

2000-10-04 Thread Dieter Maurer

[EMAIL PROTECTED] writes:
  using LocalFS 0.95 war fine until trying to upgrade to Zope 2.2.2. Both
  freshly installed, the following snippet raises the error: "Unauthorized",
  "You are not authorized to access read.":
  
  dtml-var standard_html_header
  dtml-var "frei['analog.html'].read()"
  dtml-var standard_html_footer
In earlier Zope versions, a method without a permission meant
"can be used freely". Now, it means "cannot be used via DTML/URL".

Thus, you must provide a permission for "read".
Unfortunately, "read" is not a method of "LocalFS" but from
the Zope objects wrapped around the files.
You, probably, will not want to change the respective Zope
sources.

The quickest solution for you would be an external method
that gets the file, performs the "read" and returns the result.

Alternatively, you may subclass the Zope object classes,
provide a permission for "read" and use them in
"LocalFS._create_".


Dieter

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




[Zope-dev] How to add a SessionID to each page

2000-10-04 Thread Loibl Johann

Hi,
I would like to add a SessionID at the end of each requested URL because I would like 
to know which pages were requested by one user in one session.
For example like AMAZON does it:
www.amazon.com/books?SessionID=123456 http://www.amazon.com/books?SessionID=123456 
My problem: 
There are to many pages belonging to my homepage that I can't rewrite each link like: 
a href="next_page?SessionID=dtml-var SessionID"next_page/a

Also I tried to pass a SessionID with the help of SiteAccess but a automatic insertion 
of a random ID doesn't work at my machine.

Could anyone give me please a helping hand?  
(Also, excuse my English)

Thanks, Hannes

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




Re: [Zope-dev] Need help tracking down the cause of a traceback

2000-10-04 Thread Dieter Maurer

Hi Skip,

Skip Montanaro writes:
  
  I occasionally get tracebacks like
  
  No input for required field
  
File /home/dolphin/skip/src/Zope/lib/python/ZPublisher/HTTPRequest.py, line 
 445, in processInputs
File /home/dolphin/skip/src/Zope/lib/python/ZPublisher/Converters.py, line 
 115, in field2required
  ValueError: (see above)
  
  The ValueError is being raised in field2required, but I see no parameters in
  the Apache log with a name of "...:required".  That leads me to suspect that
  somehow the RESPONSE parameter isn't getting set (it's the only
  non-defaulted parameter in the suspect published methods that doesn't appear
  to have its value set directly by parameters in the URL).

I suspect the problem comes from a "POST" operation.
You will not see POST operation parameters in the web server log
files.

It is highly unlikely that a missing RESPONSE causes the problem.
Such an error would be handled at a different place (I think
in "mapply").

At line 444 of "ZPublisher/HTTPRequest.py", you will see the following
code:
if flagsCONVERTED:
try:
item=converter(item)
except:
if (not item and not (flagsDEFAULT) and
defaults.has_key(key)):
item = defaults[key]
if flagsRECORD:
item=getattr(item,attr)
if flagsRECORDS:
item.reverse()
item = item[0]
item=getattr(item,attr)
else:
raise

Add "print key; sys.stdout.flush()" before the final "raise".
This will print the corresponding "key" (with is missing).

To get more information: the variable "fslist" contains all
parameters. It is a list of objects. Each object has a "name"
attribute (which gives the form variable name or 'key'),
the object either has a "file" or "value" attribute.
You may look at line 370, to see how it is processed.

You can test your debugging code in your test environment.
Simply create a form with a "xxx:required" variable name
and do not provide a value.


Dieter

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




Re: [Zope-dev] ZPatterns: SkinScript discovery

2000-10-04 Thread Phillip J. Eby

Just out of curiosity, did you find this out by reading the draft
SkinScript reference documentation on the ZPatterns Wiki?

At 03:45 PM 10/4/00 +0100, Steve Alexander wrote:
I just found out that you can access all sorts of useful methods in
SkinScript from the magical "_" namespace variable.

Let's say I have a DataSkin that has a propertysheet "journey", which
has a "steps" property of type "lines". I can expose its "steps"
property as an attribute, and also a neatly formatted version of the
same, using this SkinScript:

WITH self.propertysheets.get('journey') COMPUTE
  steps=getProperty('steps'),
  steps_comma_sep=_.string.join(self.steps, ', ')



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




Re: [Zope-dev] ZPatterns: SkinScript discovery

2000-10-04 Thread Steve Alexander

"Phillip J. Eby" wrote:
 
 Just out of curiosity, did you find this out by reading the draft
 SkinScript reference documentation on the ZPatterns Wiki?

No. I just guessed.
I think I might have read it in the source the other day too.

I'll take a look at the wiki now:
http://www.zope.org//Members/pje/Wikis/ZPatterns/SkinScriptSyntax

  expression

  A DTML-style Python expression. As with DTML, the "_"
  object is available for access to Python built-ins and
  library functions. 

Aha!

I'm looking forward to using the new "OTHERWISE LET" clause too, when
the next release of ZPatterns comes out.

Thanks.


 At 03:45 PM 10/4/00 +0100, Steve Alexander wrote:
 I just found out that you can access all sorts of useful methods in
 SkinScript from the magical "_" namespace variable.
 
 Let's say I have a DataSkin that has a propertysheet "journey", which
 has a "steps" property of type "lines". I can expose its "steps"
 property as an attribute, and also a neatly formatted version of the
 same, using this SkinScript:
 
 WITH self.propertysheets.get('journey') COMPUTE
   steps=getProperty('steps'),
   steps_comma_sep=_.string.join(self.steps, ', ')

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

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




[Zope-dev] ConflictError

2000-10-04 Thread Andre Schubert

Hi,

who can tell me a story about the following error.
thanks as

2000-10-04T15:49:35 INFO(0) Z2 CONFLICT Competing writes at,
/Management/Geyer/Cluster_1/Verstaerker_1/Modem_7/chart_images
Traceback (innermost last):
  File
/usr/share/zope_2.2/Zope-2.2.0-src/lib/python/ZPublisher/Publish.py,
line 175, in publish
  File /usr/share/zope_2.2/Zope-2.2.0-src/lib/python/Zope/__init__.py,
line 235, in commit
  File
/usr/share/zope_2.2/Zope-2.2.0-src/lib/python/ZODB/Transaction.py, line
251, in commit
  File /usr/share/zope_2.2/Zope-2.2.0-src/lib/python/ZODB/Connection.py,
line 267, in commit
ConflictError: yä



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




RE: [Zope-dev] RFClarification: Security on Product Attributes

2000-10-04 Thread Brian Lloyd

 If I have the following lines in a Python Product:
 
 def __init__(self, id): 
 """initialise a new instance of product"""
 self.id = id
   self.title = 'Title!'
 self.anInt = 0
   self.aString = 'testing'
 
 Are these attributes protected by the security machinery?
 If so, how so?

Chris - 

I've verified (any of my previous comments to the contrary) that 
simple attributes (python types) do not really play in the 
permissions machinery. The canonical way to expose such things 
for now is to expose them through method calls (which can play 
in the permissions scheme). 


Brian Lloyd[EMAIL PROTECTED]
Software Engineer  540.371.6909  
Digital Creations  http://www.digicool.com 




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




Re: [Zope-dev] Zope Suitability for Computer Lab Project

2000-10-04 Thread Andy McKay

Zope is just simply not suited to lots of writes. Use Access as the
relational database and use Zope as the reporting tool using ZODBCA to
connect to Access. Then you get the best of both worlds.

- Original Message -
From: "John Hopkins" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, October 02, 2000 10:04 PM
Subject: [Zope-dev] Zope Suitability for Computer Lab Project


Greetings from a "potential newbie".

I need to build an application for recording clients who use a computer lab.
The idea is to collect demographic information on clients who use the lab,
and session information such as date/time and whether the client attended a
class.  Objects include clients, sessions and classes (or I think they do;
I'm more used to thinking in relational terms.  I was going to build it in
MS-Access, since it's available on all the PC's in the lab, can do
everything I need (including reporting), and I know it well; on the other
hand, there are undeniable advantages to having something server-based with
minimal client dependencies.

I'm pretty sure it would take me more time to build it in Zope than in
Access, mainly because I don't know Zope yet.  What I don't know is whether
this is an appropriate application for Zope; it's not really what I think of
as "publishing"; more like data acquisition and subsequent reporting.

Observations based on experience will be gratefully received.

Thanks in advance,

John Hopkins
[EMAIL PROTECTED]



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




[Zope-dev] ZODB

2000-10-04 Thread Roch'e Compaan

I am getting really funny problems with my Zope installation and I have no
idea where to start looking.

I for instance deleted a python product from the Products directory and when
I start Zope the product is still listed in the Product list.  I then packed
the ZODB, cleared my Browser's cache, and refreshed the Product List but
still the product is visible.  I can however delete the python product
(which is by the way not in my Products directory) from the Control Panel.

Somewhere something is cached and I don't know where.  It seems to cache
errors as well and they stick.  A reinstallation fixed this problem, but now
it seems more fundamental.  I've come accross this odd caching behaviour
again after reinstall and can't reinstall every time this happens.

I run Zope 2.2.2 behind Apache 1.3.9 and do virtualhosting with the
ProxyPass directive.

Please help!!

Roché


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




RE: [Zope-dev] RFClarification: Security on Product Attributes

2000-10-04 Thread Phillip J. Eby

At 12:27 PM 10/4/00 -0400, Brian Lloyd wrote:

I've verified (any of my previous comments to the contrary) that 
simple attributes (python types) do not really play in the 
permissions machinery. The canonical way to expose such things 
for now is to expose them through method calls (which can play 
in the permissions scheme). 


IIRC, this stuff got broken by the switch to the new security machinery.
ZopeSecurityPolicy doesn't check 'foo__roles__' on the parent object the
way ZPublisher does/did.


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




Re: [Zope-dev] ZODB

2000-10-04 Thread Lalo Martins

For the third time, I have a similar problem. I deleted a
ZClass-based Product, but the objects of those ZClasses still
work - except for not having an icon or constructor, so I'm not
able to create or cut/copy/paste them.

Then, when I tried to import the newer version of the Product,
Zope gave me "Duplicate class Id", which means the old classes
still exist somewhere in its Dream realm.

This is on Zope 2.2.1. I'd really appreciate some clues on how
to bust these ghosts.

On Wed, Oct 04, 2000 at 06:51:21PM +0200, Roch'e Compaan wrote:
 I am getting really funny problems with my Zope installation and I have no
 idea where to start looking.
 
 I for instance deleted a python product from the Products directory and when
 I start Zope the product is still listed in the Product list.  I then packed
 the ZODB, cleared my Browser's cache, and refreshed the Product List but
 still the product is visible.  I can however delete the python product
 (which is by the way not in my Products directory) from the Control Panel.
 
 Somewhere something is cached and I don't know where.  It seems to cache
 errors as well and they stick.  A reinstallation fixed this problem, but now
 it seems more fundamental.  I've come accross this odd caching behaviour
 again after reinstall and can't reinstall every time this happens.

[]s,
   |alo
   +
--
  Hack and Roll  ( http://www.hackandroll.org )
News for, uh, whatever it is that we are.


http://zope.gf.com.br/lalo   mailto:[EMAIL PROTECTED]
 pgp key: http://zope.gf.com.br/lalo/pessoal/pgp

Brazil of Darkness (RPG)--- http://zope.gf.com.br/BroDar

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




[Zope-dev] Zope 2.2.2 Issue: AttributeError: __call__

2000-10-04 Thread knight

I hope I haven't overlooked anything here, and not posting ignorantly.

After installing a fresh copy of Zope 2.2.2 on Python 1.5.2, everything
seems to look ok. I created a new user with Manager, and then proceeded to
create a subfolder for a new web site to test out some things in 2.2.2. I
created some dtml documents, then I connected with ftp to create a few
more dtml documents, and a couple subfolders with docs. All dtml docs in
the main subfolder were renderable. ANY dtml docs in subfolders below that
were _not_ renderable, and spit an AttributeError: __call__ generally
inside the standard_html_header. However, thinking that there was
something wrong rendering my header, I realized there was nothing
technically wrong with the dtml in the header.

After installing some products, they all ended up complaining about the
same thing.

I have confirmed this issue with the latest checkout of Zope2 from cvs.

Can anyone else confirm this as an issue?

Regards,

Knight
[EMAIL PROTECTED]


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




Re: [Zope-dev] CORBA-ZODB: Is replacing global get_transaction() the only way...

2000-10-04 Thread John D. Heintz

Hi Jim!

Glad to here from you.  I don't think I'm clearly sharing the problem
I'm having.

See my comments below.

John Heintz

Jim Fulton wrote:
 
 "John D.Heintz" wrote:
 
  Hi all,
 
  I am about to embark on integrating ZODB with CORBA,
 
 Woo hoo!
 
  and am in the deep
  thinking phase of the endeavor.  ;-)
 
  What I want to do is _explicitly_ manage connections and transactions
  without being able to depend on what thread is running.  I know that
  this is _not_ the way that Zope works,
 
 That depends on your point of view.  The Zope publisher (ORB) largely
 automates transaction management for application programmers, so they
 don't have to deal with identifying transaction boundaries. So,
 from an application point of voew, these details are hidden.

First issue I need to clarify: I am not integrating ZPublisher, just
ZODB expose objects.  I want to do this because we are using ZODB to
persist complicated Python object (great database!) but are not
publishing them to the web.

 
 From a system point of view, Zope does manage per-thread transaction data.
 This is something a CORBA interface could provide as well.

CORBA provides two threading policies, and either could be used in a
thread/Connection per request model.  I am not intending on doing
Connection per request, I would rather manage Connections as longer
running activities so that I don't have to create servants more often
than necessary.

 
 IMPORTANT NOTE: The ZODB-provided transaction manager automatically
 manages per-thread transaction information.
 
 Were you aware of this? This sounds like what you need.

Yes, I'm pretty aware of this.  I have even studied the cPersistence.c
code, specifically the changed() function that calls the global
get_transaction() python function.
 
  but if I want to use standard
  CORBA I think I have only two choices:
  1) Explicitly associate Connections with Transactions in my CORBA
  layer.  What I need to do is allow any thread to change a Persistent
  object from some Connection,
 
 This would be nice. Basically, you want to open a ZODB database
 connection and begin a transaction at the beginning of the request.
 At the end of the request, you want to commit or abort the transaction,
 depending on whether an error occurred, and close the connection.

This is the Zope publisher model.  I want to rather keep a persistent
reference to objects in the Database (from a Connection) across CORBA
Requests.  This is the core reason that I am trying to manage
Transactions/threads/Connections explicitly.
 
  and make sure that the right transaction is
  called for "register".
 
 If I understand your requirements, then the standard transaction
 machinery should do this for you.

Except that I'm not committing or aborting necessarily at the end of a
CORBA Request.  I plan on having users login to the server and get back
a Session object that provides access to other objects in the system. 
That returned Session object will have a ZODB Connection and a
Transaction cached.  It also will expose through CORBA a commit() and
abort() method that delegates to the ZODB Transaction.

All this because I want to keep object from the ZODB Connection cache
around for a while.
 
  2) Build a complete wrapping adapter layer that does thread
  synchronization to the actual Persistent objects and proper thread for
  the transaction.
  - Lots of overhead and redundant coding - tricks with ExtensionClass
  might make this adaptation simpler to code, but still it won't be easy.
 
 I'm not sure what this is, but I think it probably isn't necessary.

This layer would exist to ensure that, across CORBA Requests, the
correct thread would be running.  The correct thread is the one that was
created in the CORBA Session object that open()ed the ZODB Connection.
 
  Obviously number one is my preferred choice.  In order to accomplish
  that, I see only two ways:
  1) Modify ZODB to maintain a Connection to Transaction link, and modify
  cPersistence.c to use that link in the changed() function instead of
  relying on the standard get_transaction() thread index.
 
 Is there a one-to-one relation between threads and connections
 (or, more precisely, is it the case that there is never more than
 one simultaneous connection per thread)? If so, then get_transaction()
 should do the right thing.

There would not be any predictable mapping from threads to connections
for any two CORBA Requests if I don't throw away the connections after a
commit() or abort().
 
  2) Replace the get_transaction() in globals to return the appropriate
  Transaction regardless of thread.
 
 It currently returns a different transaction depending on the thread.

In the CORBA exposure I would never call get_transaction().  I would use
the reference to a transaction from the CORBA Session object that
originally open()ed a database connection.
 
  Again, my preference is number one.  After going over the ZODB code, I
  _think_ that a Connection is always 

[Zope-dev] Trying to catch up - what are the best Zope tools today?

2000-10-04 Thread Itai Tavor

Hi,

I've been out of the Zope world for a few months... now I'm back and 
I need to quickly write a small-scale e-commerce application. It's 
got enough peculiarities to make it impossible to do with eTailer or 
EMarket, so I'm trying to figure out the best tools and approach to 
use for writing it, but so much has changed in Zope since I last 
worked with it. There's ZPatterns, LoginManager instead of 
GenericUserFolder, new session management products... the new tools 
seem much better than the old, but most are in development and carry 
dire warnings, and at least some of the old tools don't work in Zope 
2.2.

Can anyone provide a quick rundown of the best choices for building a 
production site at this time? I'm going to need sessions, user 
registration and login, and the usual array of e-commerce pieces 
(products, carts, orders, payments...), with all data stored in SQL.

I started reading about ZPatterns but I still can't get my head 
around it... I'm wondering if I should try to learn it fast enough 
for this project, or stick to what I already know. What in people's 
experience is the typical learning curve for ZPatterns? How much am I 
going to have to figure out to be able to build support for SQL 
storage? I couldn't find any examples for SQL use in ZPatterns - did 
I miss anything?

Thanks in advance for any comments.
-- 
Itai Tavor"Je sautille, donc je suis."
C3Works[EMAIL PROTECTED]  - Kermit the Frog

"If you haven't got your health, you haven't got anything"


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




[Zope-dev] Success! Was: Re: [Zope-dev] How is 'retrieveItem intended to work with TTWSpecialists? Specialists?

2000-10-04 Thread Steve Spicklemire


Thanks again... 

I just wanted to report that this worked like a treat! 

The actual syntax I ended up using was:

WITH ProductSpecialist.getItem(self.id) COMPUTE 
theRealThing = (RESULT is _.None) and NOT_FOUND or RESULT

WITH self.theRealThing COMPUTE 
price=RESULT.discountPrice(self.theRealThing), 
name=title, description=shortDescription, available=1

discountPrice is a method of the online catalog's original DataSkin
object, used to compute a percentage discount for 'web delivery'. My
app uses the notion of availablility. There was no such notion in the
catalog dataskins.. so I just set it to be an unconditional 'true'.

This way we didn't even to use property sheets. Basically the
skinscript could map the properties (and methods) that already existed
in the 'online catalog' onto properties of my 'virtual dataskins' so
that my app didn't need to be changed at all.

This was also nice since in my Specialist I could do things
like:

dtml-call "RESPONSE.redirect(this().theRealThing.absolute_url())"

After the user is finished working in my 'app area' they could
get redirected back to the actual object that my Specialist
was 'posing' for...

thanks!
-steve

 "Phillip" == Phillip J Eby [EMAIL PROTECTED] writes:

Phillip WITH otherSpecialist.getItem(self.id) COMPUTE
Phillip theRealThing = (RESULT is None) and NOT_FOUND or RESULT

Phillip WITH self.theRealThing COMPUTE myAttr1 =
Phillip RESULT.theirAttr1, myAttr2 = theirAttr2, # equivalent to
Phillip myAttr2 = RESULT.theirAttr2 SomeAttr, # equivalent to
Phillip SomeAttr = RESULT.SomeAttr myAttr5 = theirAttr1 *
Phillip theirAttr6


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




Re: [Zope-dev] ZPatterns design questions

2000-10-04 Thread Michael Bernstein

"Phillip J. Eby" wrote:
 
 Ty and I use ZClasses because you can see your changes much more quickly
 than if you have to restart Zope.  Basing your ZClasses on DataSkin makes
 the limitations pretty much disappear, from our point of view, because we
 never put any actual "implementation" code in our ZClasses: just domain
 logic, property sheets and UI (DTML) methods.  All the actual mapping
 to/from data storage is carried out in the appropriate Rack or Specialist,
 neatly seperated.  Occasionally we need an ExternalMethod in either the
 ZClass or the Specialist, but these are getting rarer as we find ways to
 create method-like helper objects that can be added through the Zope UI to
 accomplish common tasks.  In general, we prefer that Python written outside
 of PythonMethods be re-usable for a variety of projects rather than a
 one-up for a specific application.  YMMV.  :)

While I wouldn't say that there has been an actual 'paradigm
shift' between the original RIPP presentation and ZPatterns,
I'm sufficiently confused at this point to ask for an
explanation (with definitions and a *simple* example) of
your current thoughts on separating 'domain code' from
'implementation code', both of which still need to be
separated from 'presentation code' (DTML interfaces), unless
I'm mistaken. Please assume I'm asking a lot of 'why'
questions along the way.

I'm familiar with the convention of separating 'data' from
'business logic' from 'presentation logic', but this new
four-way separation (storage, domain, implementation, UI) is
confusing the heck out of me.

I know that both of you (Phillip and Ty)  are very busy
right now, but could you perhaps give us a few short
installments? Starting at the beginning (wherever that is),
of course.

Thanks,

Michael Bernstein.

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




Re: [Zope-dev] Trying to catch up - what are the best Zope tools today?

2000-10-04 Thread Michael Bernstein

Itai Tavor wrote:

 Can anyone provide a quick rundown of the best choices for building a
 production site at this time? I'm going to need sessions, user
 registration and login, and the usual array of e-commerce pieces
 (products, carts, orders, payments...), with all data stored in SQL.

As far as user registration and logins, LoginManager in
conjunction with the Membership product seem to have reached
a semi-stable implementation. It took me some serious
skull-sweat to figure them out enough to do SMB
authentication from a Solaris box off of a NT PDC, and some
more to get LM to participate in the local roles machinery,
but once I did, it's been working really well. I assume that
creating an SQL UserSource won't be any more dificult. Good
Luck.

Warning: :-)

The current membership product has not yet been
re-integrated with the PTK, so the implementation (though
stable) may have further architectural changes coming down
the pipe.

HTH,

Michael Bernstein.

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