Re: [Zope-dev] urllib not available in Python Scripts?

2000-12-16 Thread Ken Manheimer

On Sat, 16 Dec 2000, Evan Simpson wrote:

 From: "Itai Tavor" [EMAIL PROTECTED]
 [...]
 Sure.  Since you've already got a MoreBuiltins module, that's probably a
 fine place to put this.  In MoreBuiltins/__init__.py (or a brand new Product
 directory of your choice) put the following lines:
 
   import urllib
   urllib.__allow_access_to_unprotected_subobjects__ = 1
 
 ...and similarly if you want to declare other modules PS-importable.  As of
 2.3, the proper way to do this will be:
 
   from AccessControl import ModuleSecurityInfo
   ModuleSecurityInfo('urllib').setDefaultAccess(1)

I wonder whether that ought to be something like:

  from AccessControl import ModuleSecurityInfo, ENABLE_ACCESS
  ModuleSecurityInfo('urllib').setDefaultAccess(ENABLE_ACCESS)

?

The benefit of having an explicit name for "enable" is marginal, but would
become significant if there were other access modes besides ENABLE and
DISABLE - eg, "ENABLE_METHODS", "ENABLE_ATTRIBUTES", etc...

Ken Manheimer
[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] Problem in current CVS

2000-12-16 Thread Jimmie Houchin

Hello,

I just updated my current CVS build of Zope2.

I do ./start and get a traceback.
The last lines of which are:
File "/usr/local/zope/Zope2/ZServer/HTTPResponse.py", line 95, in ?
   from ZPublisher.HTTPResponse import HTTPResponse,
end_of_header_search
ImportError: cannont import name end_of_header_search

I go to the line in HTTPResponse and end_of_header_search is commented
out.

Is there a reason? Looks like it may have been part of Evan's
content-length bugfix?

Thanks,

Jimmie Houchin

___
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] more on keyword indexes

2000-12-16 Thread Steve Alexander

Josh Zeidner wrote:

 
 As for the ( MediaKeywords in ['ouch'] ) this is featured on a Zope 
 article about keyword indexes and it should be updated.

You're right. The HOWTO at

   http://www.zope.org/Members/AlexR/KeywordIndexes

has "in" instead of "=" in the last example. So,

dtml-in "Catalog.searchResults(doc_keywords in ['Squids', 'foo' 'bar'])"

should read:

dtml-in "Catalog.searchResults(doc_keywords=['Squids', 'foo' 'bar'])"

I've cc-ed Alex, the author of the HOWTO, into this message.


  OK.  Is it possible to query keyword indexes for several keywords at 
 once?  If so, what is the syntax?

What exactly do you mean? You can do a search for 'Squids' or 'foo' or 
'bar' in a particular keyword index using the syntax given above.

 Again, I am reporting a bug I have 
 found that even if I am querying for only one( using the aformentioned 
 syntax ), the results are unpredictable.  

I explained in a previous message that I had tried to do what you 
described, and I could not reproduce your bug. Everything came out 
consistently, as I would expect.

 I am using CatalogAware 
 ZClasses and I am quite sure that the words are indexed( by reporting 
 the featured MetaData ).

Ok. Describe exactly the steps I need to take, from an empty zope, to 
reproduce your bug. I'll try this out and either tell you what you've 
done wrong, or give you a patch to ZCatalog, depending where the fault 
lies. Don't forget to say exactly what version of Zope and what version 
of Python you're using.

--
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] How to make two racks work under one specialist?

2000-12-16 Thread Dirksen

I set up two racks in one specialist, one is maleMemberRack, the other 
femaleMemberRack.
Both are loaded by accessing attribute id, and have skinscripts to retrieve data from a
db. Suppose the femaleMemberRack gets loaded first, it finds out from the db that the
'id' is a male, then how can it pass the process to the maleMemberRack?

Dirksen

__
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/

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




Re: [Zope] More on DB Transactions

2000-12-16 Thread Tino Wildenhain

We are using ZmxODBC for a bounch of ODBC databases as well on 
windows as on linux. Out of the box its not very well written.
If you patch it here and there, it works much faster then ZODBC-DA,
that is, its multithreaded.
I'm not complete happy with my patches, so I dont release them 
in this current state. But I will do so soon. On request, I can
give what I have now.

Regards
Tino Wildenhain


Rik Hoekstra schrieb:
 
  Paolo Quaglia wrote:
 
  Reading the [EMAIL PROTECTED] archive I found one message with an
  interesting sentence:
 
  [Message]
   I am currently considering and evaluating Zope as one of the options
  we have
   to build a really large, completely databasedriven "enterprise
  scale"
   web-platform. I am a bit worried about this "maximum of 7 threads
  per db
 
  This isn't a maximum.  It's just the default.  It's easy to increase
  the
  number of connections.
  [/Message]
 
 
  Where is this Default and How can I increase this counter??
  Thanks very much in advance
 
 
 AFAIK the ZODBC adapter is still single threaded. See
 http://www.zope.org/Members/petrilli/DARoadmap for more information,
 though I'm not certain wether this page is still up to date. There are
 rumours that for SQL Server you could use the mxODBC adapter, though I
 know nothing more of it. Recently there were posts on this list about
 using the ZSybase Adapter for SQL Server they're probably thread safe as
 well (?).
 Do a search in the archives for more info

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




RE: [Zope] I SOLVED!!

2000-12-16 Thread Paolo Quaglia


Sure I will post My detailed solution in a few days!!

Ciao to all

Paolo Quaglia 


-Original Message-
From: Eric Walstad [EMAIL PROTECTED]
Date: Fri, 15 Dec 2000 11:10:45 -0800
Subject: RE: [Zope] I SOLVED!!

 Hi Paolo, you should post your solution to the mailing list so that
 if
 others run into your same problem they can find your solution by
 searching
 ht emailing list archives.
 Just a thought.
 Eric.
 
 //  -Original Message-
 //  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf
 Of Paolo
 //  Quaglia
 //  Sent: Friday, December 15, 2000 10:26 AM
 //  To: [EMAIL PROTECTED]
 //  Subject: [Zope] I SOLVED!!
 //
 //
 //  THANKS TO ALL for your help But I solved the Probs with the PoPy
 DA.
 //
 //  Ciao
 //
 //  Paolo
 //
 //
 //
 //
 //  ___
 //  Zope maillist  -  [EMAIL PROTECTED]
 //  http://lists.zope.org/mailman/listinfo/zope
 //  **   No cross posts or HTML encoding!  **
 //  (Related lists -
 //   http://lists.zope.org/mailman/listinfo/zope-announce
 //   http://lists.zope.org/mailman/listinfo/zope-dev )
 //
 



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




Re: [Zope] How to make two racks work under one specialist?

2000-12-16 Thread Steve Spicklemire


Hi Dirksen,

   Hmm... why not have the query that gets data qualify by gender:

SQL Query: getMemberByGender

parameters member_id, gender

select * from members where
  dtml-sqltest member_id type=string and dtml-sqltest gender type=string

Then in the SkinScript for maleMemberRack:

WITH QUERY getMemberByGender(member_id=self.id, gender='male') COMPUTE blah, blah, 
blah 

-steve

 "Dirksen" == Dirksen  [EMAIL PROTECTED] writes:

Dirksen I set up two racks in one specialist, one is
Dirksen maleMemberRack, the other femaleMemberRack.  Both are
Dirksen loaded by accessing attribute id, and have skinscripts to
Dirksen retrieve data from a db. Suppose the femaleMemberRack
Dirksen gets loaded first, it finds out from the db that the 'id'
Dirksen is a male, then how can it pass the process to the
Dirksen maleMemberRack?

Dirksen Dirksen

Dirksen __ Do You
Dirksen Yahoo!?  Yahoo! Shopping - Thousands of Stores. Millions
Dirksen of Products.  http://shopping.yahoo.com/

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


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




Re: [Zope] How to make two racks work under one specialist?

2000-12-16 Thread Steve Spicklemire


Hi Dirksen,

   Forgot to mention... you should probably choose some attribute other 
than 'id' as the attribute to check for your DataSkin. The 'id' attribute
is always there... 

-steve

 "Steve" == Steve Spicklemire [EMAIL PROTECTED] writes:

Steve Hi Dirksen,

SteveHmm... why not have the query that gets data qualify by
Steve gender:

Steve SQL Query: getMemberByGender

Steve parameters member_id, gender

Steve select * from members where dtml-sqltest member_id
Steve type=string and dtml-sqltest gender type=string

Steve Then in the SkinScript for maleMemberRack:

Steve WITH QUERY getMemberByGender(member_id=self.id,
Steve gender='male') COMPUTE blah, blah, blah

Steve -steve

 "Dirksen" == Dirksen  [EMAIL PROTECTED] writes:

Dirksen I set up two racks in one specialist, one is
Dirksen maleMemberRack, the other femaleMemberRack.  Both are
Dirksen loaded by accessing attribute id, and have skinscripts to
Dirksen retrieve data from a db. Suppose the femaleMemberRack
Dirksen gets loaded first, it finds out from the db that the 'id'
Dirksen is a male, then how can it pass the process to the
Dirksen maleMemberRack?

Dirksen Dirksen

Dirksen __ Do You
Dirksen Yahoo!?  Yahoo! Shopping - Thousands of Stores. Millions
Dirksen of Products.  http://shopping.yahoo.com/

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


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




[Zope] Manage tar-file and store them externally

2000-12-16 Thread rgoestenmeier



Hi,i am just a beginner with Zope and trying 
to setup my first Zope Website.

I cant to manage Files (.tar, ...) on this 
Website.Could you tell me, how you implemented your Website for Download 
(and the member area), where i can scan through the archive (.tar, .tgz) and 
download it.

Additionally i want to keep the file seperatly on 
an filesystem and not in the Zope Object Repository.

Thanks very much,

Ralph (Zope Member Name: 
ralphg)


[Zope] skinscript and ZSQL

2000-12-16 Thread Aaron Payne

Hi all,

I'm trying to use Gadfly as storage for a Zpatterns rack.  With the 
following skinscript trigger I can view records in the database.  But I 
can't insert a new one.

WHEN OBJECT ADDED CALL sqlInsertProduct()

WITH QUERY lookup_product(client_name=self.id) COMPUTE 
client_name,email,rate,last_payment,primary,services

Where:

sqlInsertProduct is a zsql method.
args: client_name email rate last_payment primary services
Query template:
INSERT INTO clienttracker_table
(client_name, email, rate, last_payment, primary, services)
VALUES
(
'dtml-var client_name',
'dtml-var email',
'dtml-var rate',
'dtml-var last_payment',
'dtml-var primary',
'dtml-var services'
)

lookup_product is a zsql method.
args: client_name
Query template:
select * from clienttracker_table where
dtml-sqltest client_name type=string


client_name,email,rate,last_payment,primary,services are fields of the 
table clienttracker_table and properties of the dataskin.

If I remove "=self.id" from the trigger I am able to add a record to the db 
through the trigger.
Without "=self.id" in the trigger I am unable to view the records in the db.


I noticed in a post today that said

... you should probably choose some attribute other
than 'id' as the attribute to check for your DataSkin. The 'id' attribute
is always there...

Objects are loaded by accessing attribute client_name and I still get the 
"object already exists" error.

Questions:
-Should I just create the record directly with the zsql method?  That would 
defeat the purpose of using ZPatterns.
-How do I eliminate the "already exists" error

Zope version: Zope 2.2.1
Python version: 1.5.2
System Platform: freebsd4

-Aaron


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




Re: [Zope] Stupid File Upload Question

2000-12-16 Thread Fred Yankowski

On Fri, Dec 15, 2000 at 07:22:43PM -0500, [EMAIL PROTECTED] wrote:
 Anyway, be absolutly sure that your form says:
 
 form method=post action=whatever method="multipart/form-data"

Of course, that should be ENCTYPE instead of the second METHOD
attribute name: 

  form method=post action=whatever enctype="multipart/form-data"

As an aside, I found the following page to be a useful example of Zope
file-upload handling:
http://classic.zope.org/pipermail/zope/1999-July/006591.html

-- 
Fred Yankowski   [EMAIL PROTECTED]  tel: +1.630.879.1312
Principal Consultant www.OntoSys.com   fax: +1.630.879.1370
OntoSys, Inc 38W242 Deerpath Rd, Batavia, IL 60510, USA

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




[Zope] sql query results - DTML method problem

2000-12-16 Thread Lee Reilly CS1997

Hi,

I have a TINY problem, which I think there is a simple solution too...
but for the life of me, I can't find it! I'd be grateful if someone
could point me in the right direction.

I have a database setup containing details of classes, students 
lecturers. The user is prompted to enter a class code (a unique key)
which is used to query the database and return the class title. Simple.

A DTML method prompts me for the class code
-- I enter 52.139 and it posts to a method 'enterClassCodeAction',
below.

#1  dtml-var standard_html_header
#2  h2Confirm/h2
#3  pYou entered idtml-var class_code/i/p
#4
#5  p
#6  Our records show that dtml-var class_code is called
#7
#8  dtml-in expr="findClassTitle(code=52.139)"
#9  dtml-var title
#10 /dtml-in
#11 
#12
#13 /p
#14 dtml-var standard_html_footer

^ The method works fine when the class code is manually inserted (line
#8) but when I try to pass the variable from the previou post, held in
dtml-var class_code I have probs.

dtml-in expr="findClassTitle(code=dtml-var class_code)" *** syntax
error

findClassTitle is a ZSQL method for returning the class title given a
class code:

select title from classes 
where dtml-sqltest code op=eq type=float

Hmm... anyone see the problem?

Thanks a lot :)

- Best regards,

Lee

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




[Zope] Re: sql query results...

2000-12-16 Thread Lee Reilly CS1997

It's okay folks - I figured it out. 

I believe that it was Homer Simpson who once said, "Doh!".

Cheers,

Lee

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




Re: [Zope] sql query results - DTML method problem

2000-12-16 Thread Pavel V. Piankov

#8 dtml-in expr="findClassTitle(code=52.139)"

you might wanna try 
either dtml-in expr="findClassTitle(code=_['class_code'])"
or dtml-in expr="findClassTitle(code=_.getitem('class_code'))"

dtml-in expr="findClassTitle(code=dtml-var class_code)" *** syntax
error

regards.
-- 
pashah


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




Re: [Zope] ZCatalog raises index out of range exception error

2000-12-16 Thread Stefan H. Holek

On Fri, 15 Dec 2000, Martin Winkler wrote:

 On a client's server I created a ZCatalog, but when using "Find Items to 
 ZCatalog" and clicking on "Find" in the form, Zope raises the "list index 
 out of range" error shown in detail at the end of this e-mail. Then I took 
 the whole Data.fs, put it on one of our servers, where everything worked as 
 usual.

Do you have a SiteRoot-ed environment? I believe I saw this error when
trying to use the Catalog in a SiteRoot-ed folder...

No solution, sorry ;)
Stefan



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




Re: [Zope] LoginManager and SSL client authentication

2000-12-16 Thread Stefan H. Holek

On Fri, 15 Dec 2000, Mayers, Philip J wrote:

 We've got a bespoke application for storing our (very large) user account
 database here. One field a user can have is a crypted unix password (which
 I'm currently using to authenticate users). The other thing that can exist
 is the Subject or SubjectAltName of an SSL certificate suitable for client
 web authentication.
 
 Apache will validate the certificate for me (by passing a valid CA cert to
 it's configuration) and I'm running over PCGI, so by the time we get into
 Zope, we can "TRUST" the SSL_CLIENT_S_DN and SSL_CLIENT_I_DN values passed
 in. What's the next step?

What might possibly help you:

* Look into mod_ssl's FakeBasicAuth feature

* Look at those How-Tos:
http://www.zope.org/Members/unfo/apache_zserver_ssl
http://www.zope.org/Members/Roug/certificate_mapping

Regards,
Stefan


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




[Zope] footer

2000-12-16 Thread Lee Reilly CS1997

  /td/tr/table/center
  /font/td
  /tr
  tr 
td width="9%" bgcolor="#3D4E93" height="9"nbsp;/td
td bgcolor="#3D4E93" colspan="2" height="9"
  div align="right"font face="Verdana, Arial, Helvetica,
sans-serif" size="2" color="#FF"Written 
by Lee Reilly/font/div
/td
  /tr
/table
/body
/html

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




[Zope] Two problems regarding security, and eval in zope 2.2.4

2000-12-16 Thread Manuel Amador (Rudd-O) Gerente de desarrollo Alpha

Hello everyone,

I\'m having a little bit of trouble:
http://boeing:8080/manage_access - traceback of the manage_Access view in the 
ROOT folder


Traceback (innermost last):
  File /usr/lib/python1.5/site-packages/ZPublisher/Publish.py, line 222, in 
publish_module
  File /usr/lib/python1.5/site-packages/ZPublisher/Publish.py, line 187, in 
publish
  File /usr/share/zope/lib/python/Zope/__init__.py, line 221, in 
zpublisher_exception_hook
(Object: ApplicationDefaultPermissions)
  File /usr/lib/python1.5/site-packages/ZPublisher/Publish.py, line 171, in 
publish
  File /usr/lib/python1.5/site-packages/ZPublisher/mapply.py, line 160, in 
mapply
(Object: manage_access)
  File /usr/lib/python1.5/site-packages/ZPublisher/Publish.py, line 112, in 
call_object
(Object: manage_access)
  File /usr/share/zope/lib/python/AccessControl/Role.py, line 255, in 
manage_access
(Object: ApplicationDefaultPermissions)
  File /usr/share/zope/lib/python/App/special_dtml.py, line 120, in __call__
(Object: access)
  File /usr/lib/python1.5/site-packages/DocumentTemplate/DT_String.py, line 
528, in __call__
(Object: access)
  File /usr/lib/python1.5/site-packages/DocumentTemplate/DT_With.py, line 146, 
in render
(Object: _.namespace(valid_roles=valid_roles()))
  File /usr/lib/python1.5/site-packages/DocumentTemplate/DT_In.py, line 630, in 
renderwob
(Object: permission_settings)
  File /usr/share/zope/lib/python/AccessControl/Role.py, line 182, in 
permission_settings
(Object: ApplicationDefaultPermissions)
  File /usr/share/zope/lib/python/AccessControl/Role.py, line 177, in 
lt;lambdagt;
TypeError: (see above)




that was problem number one.

problem number two.

I\'d like to take the contents of a variable, and they being the name of an 
image object, render it on the web page as an IMG SRC, just like a dtml-var 
image_id.  I know this could be done with external python scripts and eval.  
But so far all i get is integeroverflows.



any ideas?  please cc: me because I\'m a little bit busy.  Thanks =)
--
   Universidad Federico Santa Maria - Campus Guayaquil
 Enviado por:  www.usm.edu.ec/computacion

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




Re: [Zope] sql query results - DTML method problem

2000-12-16 Thread Manuel Amador (Rudd-O) Gerente de desarrollo Alpha

Quoting Lee Reilly CS1997 [EMAIL PROTECTED]:

 Hi,
 
 I have a TINY problem, which I think there is a simple solution too...
 but for the life of me, I can\'t find it! I\'d be grateful if someone
 could point me in the right direction.
 
 I have a database setup containing details of classes, students 
 lecturers. The user is prompted to enter a class code (a unique key)
 which is used to query the database and return the class title. Simple.
 
 A DTML method prompts me for the class code
 -- I enter 52.139 and it posts to a method \'enterClassCodeAction\',
 below.
 
 #1dtml-var standard_html_header
 #2h2Confirm/h2
 #3pYou entered idtml-var class_code/i/p
 #4
 #5p
 #6Our records show that dtml-var class_code is called
 #7
 #8dtml-in expr=\"findClassTitle(code=52.139)\"

RING: dont do that, dtml wont work in python namespace
instead, remember that in python namespace all vars present in dtml namespace 
are inherited.

do this:
dtml-in expr=\"findClassTitle(code=_.(\'class_code\'))\"
the __.() construct is required since underscore arent allowed in python 
variable names. if the var was called classcode, you could do
dtml-in expr=\"findClassTitle(code=classcode)\"
dats it.

 #9dtml-var title
 #10   /dtml-in
 #11   
 #12
 #13   /p
 #14   dtml-var standard_html_footer
 
 ^ The method works fine when the class code is manually inserted (line
 #8) but when I try to pass the variable from the previou post, held in
 dtml-var class_code I have probs.
 
 dtml-in expr=\"findClassTitle(code=dtml-var class_code)\" *** syntax
 error
 
 findClassTitle is a ZSQL method for returning the class title given a
 class code:
   
   select title from classes 
   where dtml-sqltest code op=eq type=float
 
 Hmm... anyone see the problem?
 
 Thanks a lot :)
 
 - Best regards,
 
 Lee
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists - 
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )
 

--
   Universidad Federico Santa Maria - Campus Guayaquil
 Enviado por:  www.usm.edu.ec/computacion

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




[Zope] GUF incompatible with 2.2.4?

2000-12-16 Thread Steve Drees

Has anybody gotten GUF working on 2.2.4?


--
Steve Drees 
SysAdmin/Software Developer/Web Geek/Chief Bottle Washer
"A problem well-stated is a problem half-solved."
http://www.christianmp3zone.com/savanna


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




Re: [Zope] ZPatterns

2000-12-16 Thread Steve Alexander

Thanks Max,

I found your discussion of ZPatterns terms very thought-provoking.

Max Møller Rasmussen wrote:
 

 To avoid this zPatterns use an anbstraction of a table called a "Rack". If
 you define this Rack how it is implemented at the backend doesn't matter. It
 can be an SQL database, or saved in the ZODB. The important thing is that
 you allways acces the Rack the same way so any other part of your
 application don't have to change when you change storage backend.

That's right.

 Often you want to look at data in different ways. You have your database,
 your logic, and different ways to look at the data. This is called the
 "Model View Controller" principle in standard Geek talk.

You've described the Model-View relationship.
The Controller part is where ZPatterns gets interesting; you can use 
SkinScript to do a load of validation on your data, all in one place, in 
a fairly specific and declarative language, which gets applied on 
commiting a Zope transaction. That's powerful stuff!

 You use it to avoid duplication of data. The "DRY" principle (Don't Repeat
 Yourself). When I see an article I also want see all comments made to this
 article. Furthermore when I see a user, I also want to see the comments that
 this user has made and all the articles that he has written.
 
 Naturally you don't just copy the list of comment's to the article or the
 user. This would cause redundancy and bad problems when you change values in
 the original data. You make a new combined view of your model instead, where
 you join articles and comments on one page. So data from two different racks
 can be viewed in one place. In zPattern lingo this is called a "Specialist".
 But a "view" by any other name still smells as sweet.

I guess that's one way of doing this.

You would have three Specialists:

   Articles
   Comments
   ThreadedDiscussions

The ThreadedDiscussions specialists would act as a view of the other two 
specialists, drawing its information from both of them, behind the scenes.

You typically use SkinScript to knit these models and views together.

 To use these two nice abstractions in Zope it has to work a little more Zope
 like. Often when making a zClass you use a folderish object. the zPattern
 folder is called a "PlugIn". It can have properties just like a normal
 zClass. 

That's not right. The PlugIns part of ZPatterns is separate from the 
Racks/Specialists/DataSkins/SkinScript part.
I think what you are describing here is makign a ZClass that is derived 
from DataSkin and ObjectManager, and then using instances of that ZClass 
in the ZODB (as you would a normal ZClass). However, if you put your 
instances somewhere below a Folder with Customizer Support, you can use 
a Customizer to play around with the attributes of your ZClass 
instances; for example, by computing them from other attributes, or 
getting them from an external database.

The PlugIns product is a tool for creating frameworks for Open 
Implementations in Zope. Basically, it is a way of adding special 
management tabs to a folder-like object, where each tab declares which 
of the folder's sub-objects it should manage. The ZPatterns classes such 
as Specialist, Rack and Customizer are built as PlugIn Managers and PlugIns.

 In zPatterns the interface or "property sheet" used for handling the values
 in a single item in a rack. (What would be a single row in an SQL table) is
 called an "AttributeProvider".

It is easiest to use SkinScript to say where each attribute of an object 
needs to come from, and what should happen when someone tries to set a 
specific attribute of an object. SkinScript serves the function of an 
AttributeProvider here.

 When you combine the content of one or more racks into a new Specialist (or
 view, remmeber?) you use a "SheetProvider" to edit the data. This is what
 would be a normal management interface in a typical web application.

That's not quite right. You use a SheetProvider to link a WebDav 
propertysheet (that is attached to a Dataskin object) to some external 
data source.

 Anyhoo, this is how I unerstand it.
 
 But I must add that I have never used zPatterns, This is all from how I
 understand the documentation, the Wiki etc combined with my limited
 knowledge of computer science.

Max, I'm extremely impressed! When I first read through your 
explanation, I figured you were a regular ZPatterns user :-)

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


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




Re: [Zope] skinscript and ZSQL

2000-12-16 Thread Steve Spicklemire


This set works for me:

--

WHEN OBJECT ADDED CALL sqlInsertProduct(client_name=self.id, 
email=self.email, rate=self.rate, last_payment=self.last_payment, 
primary=self.primary, services=self.services)

WHEN OBJECT CHANGED STORE email, rate, last_payment, primary, services 
USING sqlUpdateProduct(client_name=self.id, email=self.email, rate=self.rate, 
last_payment=self.last_payment, primary=self.primary, services=self.services)

WHEN OBJECT DELETED CALL sqlDeleteProduct(client_name=self.id)

WITH QUERY lookup_product(client_name=self.id) COMPUTE 
client_name,email,rate,last_payment,primary,services

--

Where each of the queries does the 'right' thing. You generally don't
want to attribute that you are using for the 'id' to be present in any
propertysheet since that property will come from the ZClass and fool
the 'Virtual' instance machinery. Note that if you don't specify "STORE"
on the WHEN OBJECT CHANGED line then you'll have trouble with the
Rack not being able to find attribute storage for the changed
property.

Good Luck!
-steve

 "AP" == Aaron Payne [EMAIL PROTECTED] writes:

AP Hi all,

AP I'm trying to use Gadfly as storage for a Zpatterns rack.
AP With the following skinscript trigger I can view records in
AP the database.  But I can't insert a new one.

AP WHEN OBJECT ADDED CALL sqlInsertProduct()

AP WITH QUERY lookup_product(client_name=self.id) COMPUTE
AP client_name,email,rate,last_payment,primary,services

AP Where:

AP sqlInsertProduct is a zsql method.  args: client_name email
AP rate last_payment primary services Query template: INSERT INTO
AP clienttracker_table (client_name, email, rate, last_payment,
AP primary, services) VALUES ( 'dtml-var client_name',
AP 'dtml-var email', 'dtml-var rate', 'dtml-var
AP last_payment', 'dtml-var primary', 'dtml-var services' )

AP lookup_product is a zsql method.  args: client_name Query
AP template: select * from clienttracker_table where
AP dtml-sqltest client_name type=string


AP client_name,email,rate,last_payment,primary,services are
AP fields of the table clienttracker_table and properties of the
AP dataskin.

AP If I remove "=self.id" from the trigger I am able to add a
AP record to the db through the trigger.  Without "=self.id" in
AP the trigger I am unable to view the records in the db.


AP I noticed in a post today that said

AP ... you should probably choose some attribute other than 'id'
AP as the attribute to check for your DataSkin. The 'id'
AP attribute is always there...

AP Objects are loaded by accessing attribute client_name and I
AP still get the "object already exists" error.

AP Questions: -Should I just create the record directly with the
AP zsql method?  That would defeat the purpose of using
AP ZPatterns.  -How do I eliminate the "already exists" error

AP Zope version: Zope 2.2.1 Python version: 1.5.2 System
AP Platform: freebsd4

AP -Aaron


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


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




Re: [Zope] PoPy module finally compiled but there is another prob

2000-12-16 Thread Andreas Heckel

Paolo Quaglia wrote:
 
 Hi to all
 Finally I compiled the Popy module (the 1.4) and I obtained the
 PoPymodule.so file
 I copied the module in the [ZopDir]/lib/python directory
 I installed the ZPoPyDA.0.7
 
 but When I start Zop this error occour:
 
 Traceback (innermost last):
 The PoPy module is old: Update your version of PoPy

Have a look at PoPy_db.py
Search for __compatibility__
I don't know if it was a bad thing but I changed it ot ('1.4.1',) and
the PoPyDA works.

-- 

Andreas Heckel   [EMAIL PROTECTED]
LINUX is like a wigwam ...no gates ...no windows and an apache inside
;-)

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