Re: [Zope] Presentations Available

2005-10-03 Thread David H




Thanks Bill,

I saw that in a few google hits but ... I figured that if a fair
population wants to view the presentations then the files should be in
a universal format - like pdf or rtf. 
Its an interesting question: how many people who just wish to peruse
the files will feel compelled to google and download new apps just to
be able to read them?

All best,
David

Bill Campbell wrote:

  On Mon, Oct 03, 2005, David H wrote:
  
  
Chris Withers wrote:



  Hi All,

I finally got around to putting all my presentations online from the 
conferences over the last few years.

The can now all be found at:

http://www.simplistix.co.uk/presentations

Have fun and let me know what you think!

cheers,

Chris

  

Chris,

I notice your presentation files have a ".sxi"  file extension.  Anyway 
to convert to something like pdfs?

  
  
That's the native OpenOffice.org presentation format.

B




___
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] SQL query in ZSQLMethod

2005-09-24 Thread David H




How do you want to change this notation? What is it you want to do? 
Please spend as much time writing a question as someone may in
answering it!

You do not want logic in your zsql methods.
I tend to use python scripts for branching logic, eg

# python script
request = context.REQUEST
if request.get('value1') == someValue:
   do the add zsql
else:
  do the edit zsql.


[EMAIL PROTECTED] wrote:

  
  
  
  Hi, 
  In ZSQLMethod I would have SQL
query similar to this logic:
   
  IF
  value1=dtml-var value1 and
value2=dtml-var value2
  THEN
  update table set(
  name='dtml-var name'
  )where value1=dtml-var value1
and value2=dtml-var value2
  ELSE
  insert into table values(
  Id,
  
  name='dtml-var name',
  
  value1=dtml-var value1, 
  value2=dtml-var value2
  )
  I can't figure out how to change
this notation.
   
  Many greetings and thanks for every
answer!  
 
  
  




___
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] Using Structured Text and HTML-quote together for RSS 2.0

2005-09-09 Thread David H





Does this affect Chris's chances in the annual "Zope Cogeniality
Awards"? 
BTW DTML does not suck. I too have written lots of code w/it. I do
find ZPT to be preferable - but it does take effort (brain re-wiring)
and if your up to your elbows in alligators its just not the time to
convert.

I waited for the next project to go all ZPT (except with some CSS
handling).
I'm waiting for my next project to go all Zope 3 and I can't wait. :-)

All best,
David


Jonathan Cyr wrote:

  
  Dude,
  
I appreciate the amount of effort that you contribute to the
community... but that said... you really are quite rude and
obnoxious hence the "Go easy" warning.
  
Your skills in dealing with people pale in comparison to your Zope
prowess. Talking
down to people doesn't build community... no matter how right you are.
Building a community isn't about code, or rightousness... it's about
people... consider the effects of your tone on this list.
  
If you need to be right that badly, have at it You're right, DTML
sucks, ZPT and whatever else is the obvious solution... my issue is
solved... thank you so much for your time.
  
Bait taken, with apologies to all,
  
-Jon
  
Chris Withers wrote:
  Jonathan
Cyr wrote: 
I have to choose which features of Zope to
learn and use, based on a much larger criteria than I can present here.
  
I do not wish to mix ZPT and DTML in my project... I had chosen DTML,
before ZPT was mature... It may be better, but I don't care for now...
when I'm able to re-assess which pieces of Zope to use in a future
project, I may well choose it. 


Okay, whatever... 

As a professional programmer, you must see
the advantage in adhering to a project's standards and specs, as to
managing the code in the project. That is why I needed to use DTML for
my RSS. 


Uh, no, as a professional programmer, I use the best tools for the job,
and don't stand by mistakes I made before, like choosing DTML,
especially when the two can co-exist quite happilly... 

I have chosen my mix for this project, and
benefit much more from my standards docs much more than any single
feature like ZPT can provide. 


Okay, whatever... 

As far as I know, DTML is being supported
into the future, and my hand will not be forced. 


Then your hand will be burned, enjoy ;-) 

Chris 

  
  
  -- 
Jonathan Cyr
[EMAIL PROTECTED]
  




___
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] Pluggable Brains

2005-08-06 Thread David H

Hi Zope,

I've been using pluggable brains in some zSQL classes.  I have some 
questions!


a)  It seems if I initialize a variable in the __init__ method that 
variable, say self.callCount = 1 is not retained across calls, eg


#python mod
res = context.sql.brainySQL()
for rec in res:
  rec.getCallCount()  #  where getCallCount is a method inside the 
Brains class and it just returns the var defined in __init__.  But I get 
an attribute error instead.


b) Can anyone direct me to a good faq on using these things?

c)  Has anyone experience with Pluggable Brains and zSQL?  I am 
especially interest in performance issues because I intend to use 
Pluggable Brains to do *alot* of calculations - but only if the upside 
beats the downside of using them.


d) Will Zope 3 support Pluggable Brains?

Thanks,

David

___
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] strange getPhysicalRoot behaviour

2005-07-28 Thread David H

Robert-Reinder Nederhoed wrote:


Solved.


Thanks for the reactions. It works! My current code looks like this now:

#force function in '/root/functions'
far = context.restrictedTraverse('/').functions.far

x = foo()
print far(value=x)


Of course, it is stupid to make getPhysicalRoot private
when it is so easy to access the root anyway...


Why not just add 'root' to the script vocabulary?


If I recall, Casey Duncan suggested putting a python script in *root* 
named ROOT, e.g.


#module ROOT
return container

This is aquirable from anywhere else in Zope and is easy to remember.

David




___
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] Forcing Zope transaction commit

2005-07-19 Thread David H




Bakhtiar A Hamid wrote:

  On 7/19/05, David H [EMAIL PROTECTED] wrote:
  
  
Hi list,

At times (it seems)  necessary to force a Zope transaction commit.  This
might occur between two zSQL calls where the second depends on the
first's *SQL* transaction's availability but the first has not yet been
commited because the *Zope* transaction that includes both zSQL calls
has not yet been commited.

I handled this with a call to an external script as below, eg

. zSql1()
. pyCommit()
zSql2()
Publish new page

Here's pyCommit()

# ...
# Extenstion/pyCommit.py
# ...
from ZODB import FileStorage,DB

def commit( self ):
   t = get_transaction() # ZODB builtin
   if t:
  t.commit()
# ...

Thats it. And it solved my problem. Is there a reason why this is a bad
idea, all things being equal?  A better way to do it, when needed?


  
  
you're playing with fire  ;)

let zope handle the transaction

use dtml-var sql_delimeter to separate two or more sql calls

this way, if one of the call fails, the transaction will be aborted

gurus, correct me if i'm wrong, please

hth

  
  

Bakhtiar,

Thanks very much for responding.

Your idea is what I thought of at first - but my Interbase Adapter
doesn't like COMMIT statements (!) and I didn't test it out. But it
seems that would not solve the problem because both ZSQL methods are
embedded in the *same* zope transaction stream, e.g.

. Submit a page
. call ZSQL1 (part of Zope Tran 100)
. call ZSQL2 (part of Zope Tran 100) --- this depends on zSqL1
being executed but the transaction has not been executed yet, its
pending.
. Display a page
. *now* Zope commits (executes all calls - which is too late in this
case).

When ZSQL2 is called ZSQL1's results are not yet executed into my RDMS
and therefore ZSQL2 cannot see whatever ZSQL1 did. (COMMITs not
with-standing).

Its understandable that Zope might wait between page presentations to
transact all changes until
all succeed ( an exception aborts the transaction). Its just in some
cases they can't all succeed until some
are transacted.

David





(even with your recommended COMMIT) is not available at the time ZSQL2
is called.

>From what i've seen it appears that Zope commits transactions 

David





___
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] Forcing Zope transaction commit

2005-07-18 Thread David H

Hi list,

At times (it seems)  necessary to force a Zope transaction commit.  This 
might occur between two zSQL calls where the second depends on the 
first's *SQL* transaction's availability but the first has not yet been 
commited because the *Zope* transaction that includes both zSQL calls 
has not yet been commited.


I handled this with a call to an external script as below, eg

. zSql1()
. pyCommit() 
zSql2()

Publish new page

Here's pyCommit()

# ...
# Extenstion/pyCommit.py
# ...
from ZODB import FileStorage,DB

def commit( self ):
  t = get_transaction() # ZODB builtin
  if t:
 t.commit()
# ...

Thats it. And it solved my problem. Is there a reason why this is a bad 
idea, all things being equal?  A better way to do it, when needed?


Thanks,
David

___
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] numeric formatting

2005-07-16 Thread David H

Hi List,

I will have to format numbers based on country and currency types.

I understand the locale module can do this.  I've done some googling on 
this but cant seem to get anything definitive.  I've read that the local 
module is not thread-safe but I do not know how this would impact my 
Zope app.  I do know that I would want to be able to change from one 
currency format to another depending on which currency conversation the 
user may want.


Really my question is, what approach is recommended for a Zope 
application to format numbers according to currency type? 


David



___
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 and Javascript

2005-06-29 Thread David H

Rob,
As others have pointed out the approach you indicate will not work.
To summarize -
Write python script to dynamically create JAVASCRIPT code (you can 
format javascript arrays of data from your db this way). 


Then, using TAL load it in, eg
head
tal:js replace=structure 
here/python/pythonThatCreatedJavaScriptjavascript here/tal:js

/head

Which is then callable from the other javascript routines in your page.

David



Rob Boyd wrote:


I'm stuck this, and would appreciate help or pointers.

I have a form with 2 selection drop-downs. I want the user's choice of
select 1 to drive the options displayed in select 2. When the user
makes a selection in select 1, onChange calls a Javascript function
that should write select 2 options based on the result of a call to a
Python script, passing the select 1 choice as an argument to the Python
script.

But: I cannot get the Javascript var into the namespace that the TALES
expression knows about.

Example:

script
function makeDropDown() {
 var widget = document.getElementById('select1');
 var choice = widget.options[widget.selectedIndex].value;
 var data = [result of calling Python script 'foo(arg)' with
arg=choice]
 // create options for select 2
}
/script
[various html...]
select id=select1 onChange=makeDropDown()
[options...]
/select

I've tried with multiple scripts, where one has tal:content=... but
cannot figure out how the TALES expression can get at what my
javascript gets from an event. I haven't done much with JavaScript
inside Page Templates, so perhaps I'm going about this all wrong.

TIA,
Rob







___
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] merging the contents of two acl_users folders

2005-06-23 Thread David H




Jim,

It can be done, eg

 loop thru source.acl_users
   for each user object
 stuff REQUEST with name,password,confirm (password again) and roles, eg
 REQUEST.set('name',username), etc
 context.Destination.acl_users.manage_users('Add',REQUEST,RESPONSE)


David



In DTML: (via google)
 dtml-var expr="manage_addUserFolder()"
 dtml-call "REQUEST.set('name', username)"
 dtml-call "REQUEST.set('password', password)"
 dtml-call "REQUEST.set('confirm', password)"
 dtml-call "REQUEST.set('roles', ['Authenticated'])"
 dtml-call "acl_users.manage_users('Add',REQUEST,RESPONSE)"




Jim Abramson wrote:

  
  
  merging the contents of two acl_users folders

  Can it be done?
  
  If not that, the ability to move
selected users from one acl_users to another would be a decent plan B.
  
  This is a one-time move, so I consider
any effective solution viable, even if some manual hacking is involved.
  
  Thanks for any help,
  
  Jim
  
  




___
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] merging the contents of two acl_users folders

2005-06-23 Thread David H




Jim,

David H didn't think thru his answer. I do not think you can acquire
*passwords* the way I indicated. If so my suggestion will not work.
The approach will work otherwise.

Maybe someone that knows about this will pitch in. I'm reviewing
User.py now...

David
. 


David H wrote:

  
  
  Jim,

It can be done, eg

 loop thru source.acl_users
   for each user object
 stuff REQUEST with name,password,confirm (password again) and roles, eg
 REQUEST.set('name',username), etc
 context.Destination.acl_users.manage_users('Add',REQUEST,RESPONSE)


David


  
Jim Abramson wrote:
  


merging the contents of two acl_users folders

Can it be done? (programmically
obtain data from one acl_users folder and merge into another) 
If not that, the ability to move
selected users from one acl_users to another would be a decent plan B.

This is a one-time move, so I
consider
any effective solution viable, even if some manual hacking is involved.

Thanks for any help, 
Jim 

  
  
  
  
__ NOD32 1.1152 (20050623) Information __
  
This message was checked by NOD32 antivirus system.
  http://www.eset.com
  

___
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 )


__ NOD32 1.1152 (20050623) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com

  




___
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] merging the contents of two acl_users folders

2005-06-23 Thread David H




Jim,
Alright, I found the way to get needed user information in order to
merge (create users in a dest folder).

You need an external script. Otherwise you will not be able to access
acl_users _getPassword(). Local scripts enforce this for security
reasons.

So here is the external script that you can modify to your needs

#
#Zope/Extensions/getUserData.py
# just pass in the *source* acl_users folder
#
def getUserData(self,acl_users):

 users = acl_users.getUsers()
 
 dict = {}
 for user in users:
 dict[user.getId()] = {'name' : user.getUserName(), 'password' :
user._getPassword(), 'roles' : user.getRoles() }
 return dict

Then call this with a local python script:

request = context.REQUEST
users = container.getPasswords(acl_users)
for k in users:
 user = users[k]
 print k,user['password'],user['name'],user['roles'] # to test
 
Hope this helps you reach the "tipping point" if you've not already
gotten there.

David



  
Jim,
  
David H didn't think thru his answer. I do not think you can acquire
*passwords* the way I indicated. If so my suggestion will not work.
The approach will work otherwise.
  
Maybe someone that knows about this will pitch in. I'm reviewing
User.py now...
  
David
. 
  
  
David H wrote:
  


Jim,

It can be done, eg

 loop thru source.acl_users
   for each user object
 stuff REQUEST with name,password,confirm (password again) and roles, eg
 REQUEST.set('name',username), etc
 context.Destination.acl_users.manage_users('Add',REQUEST,RESPONSE)


David



Jim Abramson wrote:

  
  
  merging the contents of two acl_users folders

  Can it be done? (programmically
obtain data from one acl_users folder and merge into another) 
  If not that, the ability to move
selected users from one acl_users to another would be a decent plan B.
  
  This is a one-time move, so I
consider
any effective solution viable, even if some manual hacking is involved.
  
  Thanks for any help, 
  Jim 
  



  




___
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] Batch folder creation

2005-06-23 Thread David H




John,

Seems like external scripts and dictionaries are a theme today. You
need to check python manuals for file handling. Its a simple
implementation. Then you would parse out names and title and put them
in a dictionary and return.

then in replace range(1...10) as seen in earlier messages with
something *like*

for n in yourDictionary: 
container.manage_addFolder(id = n, title = yourDictionary[n])

David



John Poltorak wrote:

  Thanks David,

That works fine although it is a little crude. What I'd like to be able to 
do is create folders with names and titles derived from an external File 
where each line contains the name and title, separated by a comma.

Guess I need to find out how to get python to read lines from a Zope File 
object

On Wed, Jun 22, 2005 at 10:49:07AM -0700, David H wrote:
  
  
John Poltorak wrote:



  Is there any way to create folders in batch?

I need to create around 50 but don't fancy doing this manually.


 

  

John,

Put this in a python script and test.

for n in range(10):
   container.manage_addFolder(id= str(n))

David


  
  
  




___
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] Batch folder creation

2005-06-22 Thread David H

John Poltorak wrote:


Is there any way to create folders in batch?

I need to create around 50 but don't fancy doing this manually.


 


John,

Put this in a python script and test.

for n in range(10):
  container.manage_addFolder(id= str(n))

David

___
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] ZPT tutorial

2005-06-21 Thread David H




John Poltorak wrote:

  On Tue, Jun 21, 2005 at 01:24:18AM +0200, Andreas Pakulat wrote:
  
  
On 20.Jun 2005 - 23:45:34, John Poltorak wrote:


  Does a ZPT tutorial exist anywhere?
  

How about the 2 chapters in the Zope book?

  
  
I just don't find this book very helpful at all. It's written as a manual 
rather than tutorial and reminds me of a book which explains how to chop 
down a tree if you are interested in putting up some bookshelves.

What I did find useful, though, was this worked example of how to put 
together a simple application:-

http://www.plope.com/Books/2_7Edition/SimpleExamples.stx#1-6

That was much more useful than anything else I've come across so. Just 
wish there were a few more examples.


 
  
  
Andreas

-- 

  
  

  

John,
Someone put this up some time ago. Lots of Dtml-Zpt examples.
Sounds like you might wanna take a look.

http://www.zope.org/Members/peterbe/DTML2ZPT/#example1

David





___
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] ZPT tutorial

2005-06-21 Thread David H




John,

If you spent more time just *learning* Zope and HTML, etc and less time
rationalizing your lack of progress everyone would be happy.

David




John Poltorak wrote:

  On Tue, Jun 21, 2005 at 03:15:33PM -0400, Paul Winkler wrote:
  
  
On Tue, Jun 21, 2005 at 07:29:20PM +0100, John Poltorak wrote:
re. zopelabs.com:



  It probably is very useful, but I know I'd get hopelessly lost because 
there is just so much stuff on it.
  

So you prefer to ignore it?

  
  
Just how much time should you spend on something when you are deriving no 
benefit just increasing frustration?

 
  
  
Granted, zopelabs.com has flaws. It's harder to find stuff than it
should be.  Nevertheless, browsing that site, along with reading the
Zope book (the old print version), was instrumental in getting me from
knowing nothing, to the point where I became a full-time zope developer.
We didn't even have the great resource of zopewiki.org back then.
Use that too, zopewiki is your friend.
There are tons of good links from http://zopewiki.org/PageTemplates

  
  
Thanks. I'll check that.
  
  
In general, I don't know how you expect to make any progress when your
typical response to the (many) suggestions you receive on this list is
"I can't read that, it's too much work".

  
  
If I spend a couple of days on something and make no progress, I'd say 
it's 'too much work'. Wouldn't you.

I was on a course over the weekend where ordinary people in their 70's 
with no technical ability were knocking together websites in just a few 
hours with no prior training and no understanding of the 
underlying concepts involved. Why should Zope be just as easy?

 
  
  

  Most of the newbie stuff about macros 
is probably quite old by now so I doubt whether I'd find it with a 
sequential browse through the Cookbook. 
  

"probably"? "doubt"? 



  It's disappointing to find that the link from Newbies under the ZOPE 
section does not function.
  

True that. I don't know what happened to zopenewbies.net.
 


  What I really need is something like a ZPT macro which defines a header 
and footer and leaves a slot in the middle for my own content. I don't  
expect to be able to write my own macro for quite a while - too many 
pitfalls... I'm not even sure is that is how I should be approaching 
writing a home page.
  

Have you tried the tutorial that comes with Zope?
It includes at least one simple example of macros - see lesson 4.

Not sure how to run the tutorial?  The default index_html for a new Zope 
server tells you:

"""There is a built-in interactive Zope Tutorial which gets you started
with some simple tasks using the Zope managment interface. To use the
tutorial, go to any Folder and select Zope Tutorial from the add list
and click the Add button. Provide a name for the tutorial and click Add
to begin working with the tutorial.
"""

  
  
There is a quantum leap between the tutorial and being able to do anything 
useful with a website. What the tutorial needs to to handhold you through 
putting together something like the homepage of zope.org.
 
  
  
-- 

Paul Winkler
http://www.slinkp.com

  
  

  




___
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] Exiting a Loop

2005-06-15 Thread David H




Asad,
You want to break out of a DTML loop but there is no loop breaking DTML
syntax. 

Here is another candidate DTML work-around:

dtml-in someSequence
 dtml-if someCondition 
 whatever you do in the loop
 /dtml-if
/dtml-in

That way, you can avoid processing past a certain point, just that the
loop will run until the sequence reached the end. Of course if your
sequence is huge then this would be costly in terms of processing time
and then you should play the python card.

David





Jim Abramson wrote:

  Did you try dtml-try around the loop and dtml-raise inside of it?
Never done this myself, just a thought.

Jim


  
  
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On 
Behalf Of J Cameron Cooper
Sent: Wednesday, June 15, 2005 1:37 PM
To: Asad Habib
Cc: zope@zope.org
Subject: Re: [Zope] Exiting a Loop

Asad Habib wrote:


  Yes, I should not be doing this but I am using DTML not ZPT 
  

and since 


  DTML provides programming functionality and in this case 
  

the ability 


  to loop, there should be a way to exit a loop as well.
  

DTML is not a complete programming language; it simply provides some
(too-) familiar structures. You may try to treat it as such, 
and can get away with it to a certain extent, but you may run 
into limitations.

If you treat it as a templating engine (which it is) you will 
find it complete.

		--jcc
--
"Building Websites with Plone"
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.com
___
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 )

__ NOD32 1.1141 (20050615) Information __

This message was checked by NOD32 antivirus system.
http://www.nod32.com



  




___
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] Working with CSS'

2005-06-07 Thread David H




Tino Wildenhain wrote:

  Am Montag, den 06.06.2005, 20:51 -0700 schrieb Jason Leach:
  
  
hi,

I have a site developed with CSS.  We just translated the site to
German.  The problem I have is with some embedded graphics.  For
example:
#rightcolumn h1 {
	background: transparent url("i/news_title.jpg") no-repeat top left;
	height: 38px;
	width: 180px;
	margin: 0;
	padding: 0;
}

This is the English graphic.  If people are in the German side, I need
news_title_de.jpg.  But I'm not sure how to deal with this without
doing a separate CSS file.

  
  
You set some flag for example body class="de" ... 
or body lang="de ... 

Next you first set a default:

#rightcolumn h1 { background: transparent url("i/news_title.jpg") ... }

Now for each language you just overwrite the specifics:

for body class you write:

body.de #rightcolumn h1 { ...i/news_title_de.jpg ... }

for body lang you write:

body[lang=de] #rightcolumn h1 { ...i/news_title_de.jpg  ... }
  

Tito,

Thats the first example of that logic I've seen Mixing CSS
parent-child dependencies and something like:
body tal:attributes lang="request/language | nothing" 

When body lang="de" then
body.de #rightcolumn h1 { ...i/news_title_de.jpg ... }

Kicks in.

I like it!

David





___
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] Working with CSS'

2005-06-06 Thread David H

Jason Leach wrote:


hi,

I have a site developed with CSS.  We just translated the site to
German.  The problem I have is with some embedded graphics.  For
example:
#rightcolumn h1 {
background: transparent url(i/news_title.jpg) no-repeat top left;
height: 38px;
width: 180px;
margin: 0;
padding: 0;
}

This is the English graphic.  If people are in the German side, I need
news_title_de.jpg.  But I'm not sure how to deal with this without
doing a separate CSS file.

Thanks,
Jason.
 



Jason,
Here a simple minded try using:

html
 head
   title tal:content=template/titleThe title/title
tal:test tal:condition=not: python: context.REQUEST.has_key('german','')
style type=text/css
PUT CSS CODE HERE FOR GERMAN IMAGE
/style
/tal:test
 /head

Just set the request to the language and it should work,

David

___
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] Working with CSS'

2005-06-06 Thread David H

David H wrote:


Jason Leach wrote:


hi,

I have a site developed with CSS.  We just translated the site to
German.  The problem I have is with some embedded graphics.  For
example:
#rightcolumn h1 {
background: transparent url(i/news_title.jpg) no-repeat top left;
height: 38px;
width: 180px;
margin: 0;
padding: 0;
}

This is the English graphic.  If people are in the German side, I need
news_title_de.jpg.  But I'm not sure how to deal with this without
doing a separate CSS file.

Thanks,
Jason.
 



Jason,
Here a simple minded try using:

html
 head
   title tal:content=template/titleThe title/title
tal:test tal:condition=not: python: 
context.REQUEST.has_key('german','')

style type=text/css
PUT CSS CODE HERE FOR GERMAN IMAGE
/style
/tal:test
 /head

Just set the request to the language and it should work,

David

__


More simple-minded than I thot, I missed the point of your question lol.
*sorry*

David

___
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 overlay one column of a page

2005-06-05 Thread David H

Andreas Jung wrote:




--On 5. Juni 2005 11:33:42 +0100 John Poltorak [EMAIL PROTECTED] wrote:



I need some advice on how to format a page and am not sure how to 
explain

what I want to do but hope someone will figure out what I want to do...


Basically I have a home page consisting of a standard header and footer,
and three columns - the left and right ones also being standard, with
only  the middle column having content specific to a given page.

What I would like to do in the left column is have a set of links to
other  pages on the same website with the content of each of those links
overlaying the middle column.


There must be a fairly straightforward way of doing this using minimal
codeing, but I can't figure it out.

Can anyone give me a pointer to some sample code?



Create a ZPT and divide your template into slots (metal:define-slot) 
and fill the content using metal:fill-slot. Everything's documented in 
the Zope Book (there are *three* chapters on ZPT).


-aj




John,
You might also research/google css and columns.  You may find that 
cascading style sheets are a big assist in this area (in conjunction 
with Andreas suggestion).


David



___
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 in Zope 2 vs Zope 3

2005-05-28 Thread David H

Andrew Milton wrote:


+---[ Jonathan Cyr ]--
| Damn users, using all this imperfect software. These Kids Today!  ;-)
| 
| Easy Big Fella, Whooa.
| 

You must be new here We've all learnt to ignore Chris... 


He gets easily confused... or maybe he doesn't take his medication... not
sure, but, ignoring him generally works for the best d8)

 



Actually as a member of scorched by Chris club I find his acid wit 
funny.  Plus he has contributed alot to the community and has answered 
endless questions. 


David

___
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] Receiving mails

2005-05-27 Thread David H

Varun Parange wrote:


hi,
i have downloaded an SMTP server and using it i can send mails with 
the help of Zope MailHost
 
however i would also like to recieve mails how do i do this.

which additional products do i need to download...
 
regards,

varun
 

 


Varun,

I wrote a spam filter using wxpython - but all the incoming mail uses 
standard python libraries:  poplib, rfc822, email.Parser.  Just write an 
external python script to handle. 


David

___
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 in Zope 2 vs Zope 3

2005-05-26 Thread David H

Hugo Ramos wrote:


Yellow,

I think because of lazy people like me that prefer to use DTML in a
fast way than go into a deep Python level to get the job done...
I know that, eventually, one of these days I'll have to move on to
Python only but until that day comes... DTML and a little bit of
Python where needed suits me fine! :-)

Regards
Hugo

 


Hugo,
I figured as a dtml wiz a few years ago.  Now I can't image doing 
w/out python scripts and suddenly DTML gives me a headache.  I do think 
that DTML deserves a Hall of Fame Award but its time to move on.


David



___
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 in Zope 2 vs Zope 3

2005-05-26 Thread David H

Greg Fischer wrote:


I am just curious, why is DTML not good?  It does 9 out of 10 things I
want quite easily.  From my perspective, I really dont want to learn
new ways of doing things if this works.  I also have no desire to do
templating.  I can see the need for it in a large development shop,but
for me, a 1 guy operation, I have no desire to complicate things. 
DTML works so easy for me.


I do use Python scripts here and there for small and odd things that
would be difficult or impossible to do in DTML, but like I said,
that's maybe only 10% max of the functionality that I need to provide.
(probably 5-6%) Having to move everything in Python is a hassle that I
dont plan on doing for a few years.  I'll just keep using Zope 2.

I'd also be curious to know from all you other developers, what
percentage of tasks that you need to perform or functionality you need
to provide can be provided simply with DTML?  Like for me, I can do
quickly and easily do 90% of what I need in DTML.

Is DTML really that much harder to use?

I understand the whole idea of separating the logic and the
presentation, and I guess, is that part of the reason why DTML is not
as good?  But, for me, that separation is more complicated.  DTML is
easier for me.  (partly because I know it)

I dont know, DTML and the everythings an object concept in Zope are
the very things that make Zope so attractive for a small time operator
like me.  I hate to see them deprecated just because it doesnt work
for the larger companies out there.  Of course, I may be totally
ignorant about all this, huh?

Anyway, starting to ramble...  Thanks for any thoughts.
Greg

On 5/26/05, Hugo Ramos [EMAIL PROTECTED] wrote:
 


Yellow,

I have the same feeling... Python should be the primary language used
in Zope but let's not just cut the support on DTML leaving thousands
out there spinning around and having to go into Python as fast as they
can because DTML is not supported anymore.
Changes take time... Getting used to Python only in Zope takes time...
and I'm not so sure the employers out there are that kind allowing
everybody to take time making the move.


Regards
Hugo


On 5/26/05, David H [EMAIL PROTECTED] wrote:
   


Hugo Ramos wrote:

 


Yellow,

I think because of lazy people like me that prefer to use DTML in a
fast way than go into a deep Python level to get the job done...
I know that, eventually, one of these days I'll have to move on to
Python only but until that day comes... DTML and a little bit of
Python where needed suits me fine! :-)

Regards
Hugo



   


Hugo,
I figured as a dtml wiz a few years ago.  Now I can't image doing
w/out python scripts and suddenly DTML gives me a headache.  I do think
that DTML deserves a Hall of Fame Award but its time to move on.

David




 


-

 


Greg,
I agree with you:  I would not convert existing code to ZPT unless a 
client asked me to.  I too, am a one man shop  - been doing it that 
way for like 14 years.


I just made the decision to use ZPT for all *new* projects.  I didn't 
like it much at the beginning but now I wouldnt do w/out it.  ZPT has a 
magic of its own, its amazing! Plus, it seems to do force the mind to 
think in ways compatible with the direction of web developement evolution. 


The problem with DTML is its too good for, well, its own good. :-D
All best,

David


___
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] Create a list using DTML.

2005-05-24 Thread David H

Fernando Lujan wrote:


Hi,

I have a array data type in my DB wich have the following format :
{1,2,3} ( ids_test ).  Now in my web application, I have a multiple
select wich options must be marked as selected if the number is in the
array described above. How can I make the above format be converted to
a list of elements?

For instance:

html
body
dtml-in searchIdsTest
dtml-call REQUEST.set('ids_test', '['+ids_test[1:-1]+']')
/dtml-in
form
   select name=id_test multiple=true
dtml-in serch_id_test
 option value=dtml-id_test; dtml-if id_test in
ids_test selected=true/dtml-if/option
/dtml-in
   /select
/form
/body
/html

Thanks.

Fernando Lujan
___
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 )

 


Fernando,
I think you are close.  Change dtml-if ids_test in ids_test to 
dtml-if ids_test in ids_test ?

David

___
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] Create a list using DTML.

2005-05-24 Thread David H




Fernando Lujan wrote:

  
I think you are close.  Change dtml-if ids_test in ids_test to
dtml-if "ids_test in ids_test" ?

  
  
It's working like IN over a string, e.g. the [5,61] will make selected
the number 5,6 and 61.

dtml-call "REQUEST.set('ids_test', '(' + id_test[1:-1] + ')')"

Where id_test is the result of the database query wich return in this
format: {1,2,3}. I modify it to a  (1,2,3) and finally I try the
	dtml-call "REQUEST.set('list', _.list(ids_test))"

Following this api: 

list (sequence)
Return a list whose items are the same and in the same order as
sequence's items. If sequence is already a list, a copy is made and
returned, similar to sequence[:]. For instance, list('abc') returns
returns ['a', 'b', 'c'] and list( (1, 2, 3) ) returns [1, 2, 3].

I need a integer-list, is it possible?

  

Fernando,
I'm rusty with DTML But I know you can get a list returned using
_.string.split(idstest,',') 

But Id call a python script with idstest as a param, eg
dtml-call "REQUEST.set('myList',pyMakeList( idstest ))"
Eg,

python
import string
idstest = '{1,2,3}' # test only is param

s = s[1:-1]
list = string.split(s,',')
return list

Good luck!
David




___
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] Hiding HTML URL

2005-05-23 Thread David H

Chris,
I didn't address any of the points you made, but I've decided to address 
two:
(1) When I asked what was inherently defective about a stable URL you 
answered:


a) It's grim to debug
Chris, do you really depend on their users to report URLS to support 
when things go wrong?  I use exceptions, logs and auto-emailing of 
exceptions as a work around - what was I thinking! :-)  


Then you added
b) (stable url will ...) confuse your users even more when it goes 
wrong. but the thingy in the box is still the same, why is it not working
Chris, this may come as a shock to you, but my users say something 
incomprehensible like Purchase Order Edit  is not working or COA 
Maintenance needs A, B and C.
Somehow I  know what they are talking about - and so do they. 

(2) Then, I said If there are superior patterns (for Business Apps) Im 
the first that wants to see them and this is  a welcome discussion


And you asserted ... there are *many* but that are beyond the scope of 
this list


Simple disagreement! I feel its a neglected subject and should be on 
this list.  OK maybe on Sundays?


All best,
David



___
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] Equivalent of context ZPT variable in DTML ?

2005-05-22 Thread David H

KLEIN Stéphane wrote:


Hello,

What is the equivalent in DTML of ZPT context variable ?

Thanks for your help,
   -- Stéphane

___
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 )

__ NOD32 1.1105 (20050522) Information __

This message was checked by NOD32 antivirus system.
http://www.nod32.com




Stephenie,
Someone may correct me on this but I think its assumed in DTML.
So dtml REQUEST = p tal:content=context/request  or p 
tal:content=python:  context.REQUEST


David


___
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] response.redirect not working

2005-05-20 Thread David H
Artras wrote:
Hello,
I have a web page, a form on it, and on form submit action (to the same 
page) I do some database actions (update some record, to be correct). The exact 
code looks like this (filename edit_html):
.
(1) dtml-if form
(2)   dtml-call RESPONSE.redirect('index_html')
 p style=color:greenbSaved./b/p
(3)  dtml-in db_fulluseredit(zd=_['zd'], orig_login=_['uid'], login=_['login'], vardas=_['vardas'], pavarde=_['pavarde'], 
   nickas=_['nickas'], email=_['email'], address=_['address'], phone=_['phone'], pastabos=_['pastabos'], 
   date_gime=_['date_gime'], date_valid=_['date_valid'], planas=_['planas'], current_user_login=AUTHENTICATED_USER.getUserName())

.
On #1 line I check if form variable is defined (it's defined in form, so if the form is 
opened for the first time, the form is naturally null, and if the form is submitted - 
it's defined to 1 [input type=hidden name=form value=1] ). #2 line let's skip for 
a moment. On #3 line I do database actions with result checking. (On a wider scope - the 
form is for user properties management - name, surname, address, login, phone, notes 
 etc.).
The problem is on line #2. According to what's written, zope should drop 
everything and do immediate redirect to page index_html (ok, it's not where the 
first error appeared, I just managed to generate this error as the most 
clearest and best visible one), but instead zope calmly executes database 
actions and does other stuff till the end of the document.
Id be very thankful for any ideas... it's sad not to control own code :/
If you want, I can send you the whole code as well as to provide access to the 
live system.
Zope version: 2.6.4-1.8. Debian, postgresql 7.4 (latest 7th, I don't remember 
exact version now).
Artras
[EMAIL PROTECTED]
___
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 )

__ NOD32 1.1103 (20050520) Information __
This message was checked by NOD32 antivirus system.
http://www.nod32.com

 

Arturas,
RESPONSE.redirect drops request (including form vars).  Maybe thats a 
clue? 
David

___
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] Hiding HTML URL

2005-05-19 Thread David H




Florent Guillaume wrote:

  David H  [EMAIL PROTECTED] wrote:
  
  
If I might disagree, keeping a stable URL is not, by itself,  
"user-defeating".  For example, user's do not like browser history 
clutter with subfolders and objects - all from the same application. 

  
  

www.myApp.com/updateChartOfAccounts.
Because that would be "out of 

  
context".  Sure you can respond with an error message.  But why should 
they see it in the first place?

  
  
They shouldn't, the application should be written in such a way that
this is a POST, and it won't appear in the history.
  

POST conceals parameters not paths from history. And I only described a
WAY to handle the problem.


  
With a stable URL they just click www.myApp.com and they get the main 
page - every time.

  
  
That's what bookmarks are for. You're trying to force your ideas of
bookmarking and history management to the users.
  

I wish I could impose my ideas on users. I respond to specs. Yes, I
will fight the good fight when a spec is silly. I've even turned down
gigs because the client was stubborn and what they wanted would be a
disaster. But URL "cloaking" is not silly to some clients and the
pattern I described handles it nicely and has benefits well beyond
maintaining a stable URL.
Note: Sometimes I sense a "culture clash" between Advanced Zope
developement guys, Web presentation guys and us lowly application
developers that get the joy of accounting systems online.


  
The question remains - is there an elegant solution to this.

  
  
What you call "stable URL" everybody else calls "cloaking" or "jailing".
It *is* hostile to the user.

  

Im curious, how is it "hostile" to a user? 

If
there are superior patterns (for Business Apps) Im the first that wants
to see them and this is a welcome discussion. :-) 

Thanks very much Florent,

David








___
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] Answer's Time

2005-05-19 Thread David H
Chris McDonough wrote:
You may want to use a tool like wget or curl to examine the response
from the server for the clicked URL.  This could be many things.
- C
On Thu, 2005-05-19 at 18:37 -0300, Fernando Lujan wrote:
 

I'm having the following problem and wanna know whether it can be
associated with Zope.
I have a page in my system with various links, and when I click in a
link, for instance link 1.
The cursor starts being busy, the browser appear to send the request
but there is no response. When it happens, if I open another window
and click in the same link, I have the response immediately.
It's tuly very weird... How can I debug it? I'm using Zope 2.74 with
python 2.3.4.
Suggestions will be welcome. Thanks and regards.
Fernando Lujan
   

Fernando,
FWIW,
I've had this also and with zope 2.7.4.  But only once.  I was testing 
compatibility using MSIE 6 and Mozilla 1.2 and one would do this, the 
other would not (sorry I forget which) -  same page, same link at the 
same time.  Hmmm the one time it did occur I was going back and forth 
between the browsers. 

David
___
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] dollars-and-cents display fails

2005-05-14 Thread David H
Greg Fischer wrote:
I guess my quick fix wont work.  Well, it fixes the fmt for decimals,
but there's more to the issue.  Statistical summaries, total, sum dont
work either.
In my dtml-in I might have this:
dtml-var total-decimalcolumn
or
dtml-var sum-decimalcolumn
These dont work with Mysql 5.0.4.  So, what do we have to change in
the Mysql DA or maybe the Mysql-python to fix this?
If I find anything, I'll post more.
On 5/13/05, Greg Fischer [EMAIL PROTECTED] wrote:
 

OK well, I fixed it. At least on My zope server.
The function for dollars-and-cents in DT_Var.py was like this:
def dollars_and_cents(v, name='(Unknown name)', md={}):
  try: return $%.2f % v
  except: return ''
I changed it to this:
def dollars_and_cents(v, name='(Unknown name)', md={}):
  try: return $%.2f % float(v)
  except: return ''
Problem solved.  I just tested it in Mysql 5.0.0 and 5.0.4, and it
works great.  I'll setup the rest of my app and test some more to make
sure I am not missing something. If there are any problems I'll post
more details.
Is this something that could be posted on the Zope Collector?  It
should probably be tested on lots of other Db's I bet.  But, one
question I have, should this be handled in the Mysql DA?
On 5/13/05, Greg Fischer [EMAIL PROTECTED] wrote:
   

http://dev.mysql.com/doc/mysql/en/numeric-type-overview.html
That's it right there!  Before 5.0.3, they were unpacked, meaning
saved like a char.  Now they are packed, fixed point numbers.  This is
screwing up the python functions for fmt.
Well, I was trying to NOT redo all that code, but looks like I will
have to if I want to run the new mysql.  I have tons of reports using
dtml and fmt.   I think I'll stick with 5.0.0 for now until I have
time for that. (spent it all trying to figure out where my problem
was!)
Though, I might just switch to Firebird if I have to do some code
changing on my app anyway.  It's a bit more mature than Mysql's new
stuff. (considering it's still in beta)  Mysql is just so easy.
-
On 5/13/05, Greg Fischer [EMAIL PROTECTED] wrote:
 

ok, lots of testing, and I have found that this is related to Mysql 5.0.4.
I compiled and installed Mysql 5.0.0 and the problem does not exist. I
guess means that it started in 5.0.1 or higher.  I read through the
change logs and saw a couple of items related to float values on 5.0.3
and 5.0.4, but I dont have any idea if those are causing the issue.
So, I dont know where to go next.  I can post this info on the mysql
lists, but I only see the problem in Zope.  Python, or at least the
MysqlDA, retrieves the value just fine.  I only get the problem if
using a fmt option on Zope.
Here's a recap:
-- I can use Zope 2.7.4 with Mysql 5.0.4 on Windows (using Egenix ODBC
DA) and there is no issue.
-- I can use Zope 2.7.3 with Mysql 5.0.0 on Linux (Zmysqlda 2.0.9b3,
Mysql-python1.2.0,Python 2.3.4) and there is no issue.
-- When using Zope 2.7.3 with same setup as before, but with Mysql
5.0.4, problem exists.
-- Zope 2.7.6 has same issue.
I tried doing a simple dtml:
dtml-call REQUEST.set('dec',10.23)
dtml-var decbr
dtml-var dec fmt=dollars-and-centsbr
This works just fine.  But when pulling 'dec' from Mysql, dtml wont
render it if using fmt.
I dont have to use Mysql 5.x.  It's just that I already have the app
running on it, and I'd like to start testing the stored procedures and
other useful features.
Sorry for the long post.  I just want to give as much info as
possible.  Thank you for any help!
Greg
On 5/12/05, Greg Fischer [EMAIL PROTECTED] wrote:
   

Oh, it is a decimal(15,2) column.  (all of them are)  Just thought I'd
mention everything too... Running Ubuntu 5.0.4, has the Python 2.4.1
package installed, but I have Python 2.3.4 compiled and installed
separately for Zope.  Zope is compiled with the --with-python flag.
Just tried your suggestion, commenting the 'conv[FIELD_TYPE.DECIMAL] =
float' line, restart Zope, still have the issue.
So, I have the older Python, which I used to have.  I could try
loading an older Zope, but what I might try is loading the MySQL
5.0.0, which I had before.  At least I can hopefully find out which is
causing my problem.  However, I have Zope 2.7.4 with MySQL 5.0.4 and
it works fine, but on Windows using the Egenix adapter.  Now, I cant
remember what I had for the mysql-python version, it's on the other
server at my clients site. (cant get to it right now)
I guess one of my main questions too is, would Zope be getting
anything from the 2.4.1 Ubuntu packages that are installed if I
compiled it with the 2.3.4 python?  (mysql-python is installed
correctly on 2.3.4 too)
On 5/12/05, Andy Dustman [EMAIL PROTECTED] wrote:
 

On 5/12/05, Greg Fischer [EMAIL PROTECTED] wrote:
   

Thanks Andy.  I do have those versions.  But Python is 2.3.5 because I
didnt want to move to 2.4.x as I think I read something in the README
for Zope stating it was not tested for compatibility. (right?)  I
guess my thought is... Does 2.3.5 have the same issue as 2.4 

Re: [Zope] Hiding HTML URL

2005-05-09 Thread David H




Allen Huang wrote:

  I just want to show my root URL address whenever people browse
into other pages of my site. How do I do this in dtml or python script
or external method??
   
  
Allen,

You can use index_html as a "call dispatcher". Each ZPT, DTML, etc
form's action should = "." or "index_html". 

Example:
// .
EditForm
// .
head
script type="text/css"
function Process() }{
 document.form.action_type.value = "Process"
 document.form.submit()
}
function Cancels() }{
 document.form.action_type.value = "Cancel"
 document.form.submit()
}
/head
body
h1my big page/h1
..
form action="" method="post
input type="hidden" name="caller" value="editform"
input type="hidden" name="action" value=""
.
.
input type="button" 
value="Process"
input type="button" 
value="Cancel"

/form
# -
index.html (i use python for this)
# ---
request = context.REQUEST
if caller == "editform":
 if action_type=="process"
 return context.Main(context,request)
if caller == 'someotherform"
  return context..SomeOtherForm(context,request)  

etc

In this way, you always get your apps root directory as the url.
index_html handles all requests. 

David




___
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] Hiding HTML URL

2005-05-09 Thread David H
Jens Vagelpohl wrote:
On May 10, 2005, at 00:48, J Cameron Cooper wrote:
But please note, this is very hostile web design. I would suggest  
you re-think your need for such a feature.

Hostile is an excellent word for that kind of behavior. It  
certainly breaks quite a few rules in the user friendliness book.

So what exactly is the goal for following such a user-defeating  
technique?

jens

If I might disagree, keeping a stable URL is not, by itself,  
user-defeating.  For example, user's do not like browser history 
clutter with subfolders and objects - all from the same application. 

Also, we do not want a user to open browser history and click 
www.myApp.com/updateChartOfAccounts.  Because that would be out of 
context.  Sure you can respond with an error message.  But why should 
they see it in the first place?

With a stable URL they just click www.myApp.com and they get the main 
page - every time.

The question remains - is there an elegant solution to this.
I think there is.  Maybe 3 years ago Jim Penny wrote a message (I wish I 
could find it now!) regarding a web technique which I believe he 
referred to as the stateless machine. 

I liked the idea and have used it ever since.
The idea is to use index_html as a request dispatcher.  index_html 
simply responds to page requests and pulls in zpt macros, dtml and 
python code displaying to screen. An example:

index_html
request = context.REQUEST
if request[caller] == 'Budgeting':
 if request[action_type] == 'Process':
context.SQL.updateBudget()
context.ZPT.showUpdatePage(context,request)
and the caller looks like ...
Zpt module Budgeting
..
form name=budgeting action=index_html
input type=hidden  name=caller value=Budgeting
input type=hidden  name=action_type value=    see with 
javascript
input type button name=process value= Process  onclick=Process()

etc
I believe that this technique is not only useful in the stable URL 
way, but it is very useful for larger applications - index_html becomes 
the engine driving the whole application. This centralizes a big chunk 
of application logic in one place.

David


___
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] i am completely new to zope

2005-05-05 Thread David H




Paul Winkler wrote:

  On Thu, May 05, 2005 at 09:27:41AM -0700, Lukman Salifu Nayendi wrote:
  
  
i am a new user of zope, i really want to learn alot about it and know more please help.

  
  
http://zopewiki.org/ZopeWiki
http://www.plope.com/Books/2_7Edition

  

Also, get some good Zope books. I liked "The Zope Bible". The "Book
of Zope" is very good also. If you are new to python - get "Python,
the essential reference" by Beasley. 

Also *google* is your friend. Try to find answers w/it before posting
questions to the zope lists - because so many questions have been asked
and answered.





___
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] Sending mail with attachments via Python

2005-05-03 Thread David H




Kirk Strauser wrote:

  On Tuesday 03 May 2005 15:30, J Cameron Cooper wrote:

  
  
Look at the Python 'email' package:
http://python.org/doc/lib/module-email.html

You'll need to use External Methods to use this module, or allow access
to it so that you can use Python Scripts.

  
  
That's what I was afraid of.  I love Zope and Python (and am getting ready 
to write a magazine article about the two) but jumping through Pythonic 
hoops to do stuff that would be easy in DTML drives me nuts.

Thanks for the pointer, though.  I'd stumbled across that earlier, but had 
kept looking in search of something easier.
  

Kirk,
Here is some to send email + attachement. I used it to send PDFs. Use
it as a guide if you choose the external python method option. 
I think MimeWriter makes it easier. 

Best luck,
David

code snippets
import sys, smtplib, MimeWriter, base64, StringIO, os, string, time

essential code
 message = StringIO.StringIO()
 writer = MimeWriter.MimeWriter(message)
 writer.addheader('MIME-Version', '1.0')
 writer.addheader('Subject', 'Purchase Approved')
 #
 writer.addheader('To', '[EMAIL PROTECTED]' )
 # get ready to send attachment
 writer.startmultipartbody('mixed')
 # start off with a text/plain part
 part = writer.nextpart()
 body = part.startbody('text/plain')
 body.write('Services Inc.\n')
 body.write('Office Transaction notice\n')
 body.write('\n')
 body.write('Order: ' + itemNumber + '\n')
 body.write(' Authorized by: ' + userID + ' ' + datetime +
'\n')
 body.write(' Amount: ' + amount + '\n')

 
 body.write('\nSee attached')
 # 
 # add PDF attachment
 # 
 part = writer.nextpart()
 part.addheader('Content-Transfer-Encoding', 'base64')
 body = part.startbody('application/pdf; name=%s' % attachment)
 # pdf file
 body.write(base64.encodestring( pdf ))
 # finish off
 writer.lastpart()

 # ..
 # send the mail
 # . if user supplied userid/password then deal w/it
 # ..
 smtp = smtplib.SMTP(self.MailHost.smtp_host)
 if self.MailHost.smtp_userid:
 smtp.ehlo()
 smtp_userid64 =
base64.encodestring(self.MailHost.smtp_userid)
 smtp.docmd("auth", "login " + smtp_userid64[:-1])
 if self.MailHost.smtp_pass:
 smtp_pass64 = base64.encodestring(
self.MailHost.smtp_pass)
 smtp.docmd(smtp_pass64[:-1])
 
 #smtp.sendmail( from address, to address, message body)
 smtp.sendmail('[EMAIL PROTECTED]', '[EMAIL PROTECTED]',
message.getvalue())
 smtp.quit()
/end essential code




Good luck,
David


___
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] upload into a ZObject

2005-05-01 Thread David H
u1207440 wrote:

Does anyone know how to upload a file or an image into a ZObject?

I have created a simple ZClass that makes ZObjects to simulate book 
information like title, author, etc. I have selected to upload images and 
files into the ZObject, but I don't have a clue what dtml codes I should use 
to do that.

Can anyone give me some pointers??

Also, if I have a book object that was stored in either one of two folders a 
and b (assuming don't know where) and I need to get its internal information 
like the book title and author, how do I look for it using dtml??
___
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 )

  

Hi ul207440,
It happens that The Book of Zope, edited by Casey Duncan covers both
zClasses and has examples of book classes.

David


___
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] Sequence sorting module from a Python script

2005-04-24 Thread David H




Leticia Larrosa wrote:

  Hi
all: 
  

  I
want to order a sequence using the Sequence sorting module from a
Python script. 
  I
have the following code: 
"
seq = [['Bruzon', 'CUB'], ['Anand', 'IND'], ['Kasparov', 'RUS']]
def test(oneElem, twoElem):
 if oneElem[0] == twoElem[0]:
 return 0
 elif oneElem[0]  twoElem[0]:
 return 1
 else:
 return -1
  
sort_on =(('self', test, 'desc'))
return sequence.sort(seq, sort_on)
"
  
and i get the error:
"
Error Type: SyntaxError
Error 

Value:
sort option must contains no more than 2 fields

Leticia,
I tested this using a python script in Zope - and it seems to work.
Nice to see someone doing something with Chess and Zope!


def test(x,y):
 if x[0] == y[0]:
 return 0
 elif x[0]  y[0]:
 return 1
 else:
 return -1

request = container.REQUEST

seq = [['Bruzon', 'CUB'], ['Anand', 'IND'], ['Kasparov', 'RUS']]

seq.sort(test)
print seq

David


___
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 save page content to a word file.

2005-04-21 Thread David H
prabuddha ray wrote:
this again is a simple problem which got tricky for me.
 I've full page template taking parameters to generate a printable report.
Another button on this page is for saving the report to a doc file.
How can i do this in a ZPT?
 

prabuddha,
If you are using Windows then check out Python Programming on Win32 by 
Hammond and Robinson.  It shows how to use COM to communicate with 
MicroSoft Word and Excel files. 

The idea is that you will write an external python script - that 
interfaces with COM that interfaces with Word and Excel.

David
___
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] index.html in Python Script?

2005-04-21 Thread David H
Erik Myllymaki wrote:
How do address a ZPT with a name like index.html in a Python Script?
The following:
request = container.REQUEST
RESPONSE =  request.RESPONSE
if not request.has_key('next_state'):
  return container.index.html(context, request)
returns:
Error Type: AttributeError
Error Value: index
___
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 )
Erik,
I think its failing at the DOT between index and html. 
Try something like:

return container['index.html'](context,request)
David
___
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] ZPT list is dead... zpt nav question

2005-04-13 Thread David H
Norbert Ray-Goldman wrote:
so I am posting this here. I would like my zpt to list only folders in
a director - essentially filtering out all other meta_type(s)... can
you tell me where I am going wrong with the filtering here ?

html
 head
   title tal:content=template/titleThe title/title
 /head
 body
span
a href=HOME_URL tal:attributes=href container/absolute_url
  tal:content=container/title_or_idTITLE OR ID/a
span tal:repeat=item here/objectValues
a href= tal:attributes=href item/absolute_url
tal:condition=python:item.meta_type=='Folder'URL/a
/span
/span
 /body
/html
___
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 )

 

Norbert,
I copied your code example and ran it on my system (other's do 
cross-word puzzles).  It raised an authentication challenge (even though 
I'm logged in as Manager). Does it do that in your case?

The culprit (on my Zope 2.7.4) is the reference to item/meta_type (or 
python: item.meta_type) ...   I thought meta_type is an unprotected 
attribute?

David

___
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] ZPT list is dead... zpt nav question

2005-04-13 Thread David H
David H wrote:
Norbert Ray-Goldman wrote:
so I am posting this here. I would like my zpt to list only folders in
a director - essentially filtering out all other meta_type(s)... can
you tell me where I am going wrong with the filtering here ?

html
 head
   title tal:content=template/titleThe title/title
 /head
 body
span
a href=HOME_URL tal:attributes=href container/absolute_url
  tal:content=container/title_or_idTITLE OR ID/a
span tal:repeat=item here/objectValues
a href= tal:attributes=href item/absolute_url
tal:condition=python:item.meta_type=='Folder'URL/a
/span
/span
 /body
/html
Norbert,
I copied your code example and ran it on my system (other's do 
cross-word puzzles).  It raised an authentication challenge (even 
though I'm logged in as Manager). Does it do that in your case?

The culprit (on my Zope 2.7.4) is the reference to item/meta_type (or 
python: item.meta_type) ...   I thought meta_type is an unprotected 
attribute?

David


OK this is getting odder ... the problem I just described occurs only in 
the transient temp_folder.  Could someone else try this in temp_folder 
vs normal folders?,
eg

span tal:repeat=item here/objectValues
a href= tal:attributes=href item/absolute_url
tal:condition=python:item.meta_type=='Folder'URL/a
/span
Thanks,
David
___
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] cvs (versus) svn

2005-04-10 Thread David H
Hi List,
What is the status of cvs and svn in terms of which to use to get what 
software.  I found some messages indicating that Zope went to svn about 
a year ago. 

Thanks,
David
___
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] object creation in a specific folder...

2005-04-10 Thread David H
Rushabh Mehta wrote:
hello all,
this is my first zope app... i am trying to figure out how to create
an object in a particular folder via script, when my current object
may not be in the right tree...
I tried to do a 'change folder' via restrictedTraverse (eg 
context.getRestrictedTraverse('/myapp/myfolder'), and then create the
object using manage_addProduct... but it dosnt seem to work. any tips?

thanks,
___
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 )

 

Rushabh,
Give the source that failed dont just describe it.  Or, maybe first 
google zope manage_addProduct  ... I found lots of examples.  See if 
what you tried differs from the examples you find.

David
___
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: Windows compile Zope 2.8?

2005-04-09 Thread David H




Tres Seaver wrote:

  -BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

David H wrote:
  
  
Hi List,

I notice that the latest Zope does not have a Windows binary release yet
(zope 2.80 alpha 2).

I found an old Visual C 6.0 (still in the box!) and wonder if there are
instructions somewhere that I can follow to create my own binary on
Windows XP?

  
  
Assuming that VC6 is the compiler used to build Python (should be true
for Python  2.4):

  C:\Zope-2.8.0a2 python.exe setup.py build_ext --inplace

Tres.
- --
===
Tres Seaver[EMAIL PROTECTED]
Zope Corporation  "Zope Dealers"   http://www.zope.com
  

Tres,
Thanks for responding. I tried the suggestion:
  C:\Zope-2.8.0a2 python.exe setup.py build_ext --inplace
and the thing runs for a while (good sign, as visual c 6.0 is
compiling things) then I get this:

building
'Products.PluginIndexes.TextIndex.Splitter.ISO_8859_1_Splitter.ISO_8859_1_Splitter'
extension
creating
build\temp.win32-2.3\Release\Products\PluginIndexes\TextIndex\Splitter\ISO_8859_1_Splitter
creating
build\temp.win32-2.3\Release\Products\PluginIndexes\TextIndex\Splitter\ISO_8859_1_Splitter\src
C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox
/MD /W3
/GX /DNDEBUG -IC:\python23\include -IC:\python23\PC
/TcProducts/PluginIndexes/TextIndex/Splitter/ISO_8859_1_Splitter/src/ISO_8859_1_Splitter.c
/Fobuild\temp.win
32-2.3\Release\Products/PluginIndexes/TextIndex/Splitter/ISO_8859_1_Splitter/src
/ISO_8859_1_Splitter.obj
ISO_8859_1_Splitter.c
fatal error C1083: 
Cannot open source file: 
'Products/PluginIndexes/TextIndex/Splitter/ISO_8859_1_Splitter/src/ISO_8859_1_Splitter.c':

 No such file or directory
error: command '"C:\Program Files\Microsoft Visual
Studio\VC98\BIN\cl.exe"' failed with exit status 2

When I inspect
'Products/PluginIndexes/TextIndex/Splitter/ISO_8859_1_Splitter/src I
find only one file and its:
ISO_8859_64 (no extension).

I've been reviewing distUtils but just started so I'm unlcear about
this stuff still.
Any ideas?

David




___
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: Windows compile Zope 2.8?

2005-04-09 Thread David H




Tim Peters wrote:

  [David H]
  
  
Thanks for responding.  I tried the suggestion:
 C:\Zope-2.8.0a2 python.exe setup.py build_ext --inplace
 and the thing runs for a while (good sign, as visual c 6.0 is compiling
things) then I get this:

building 'Products.PluginIndexes.TextIndex.Splitter.ISO_8859_1_Splitter.ISO_8859_1_Splitter' extension
creating build\temp.win32-2.3\Release\Products\PluginIndexes\TextIndex\Splitter\ISO_8859_1_Splitter
creating build\temp.win32-2.3\Release\Products\PluginIndexes\TextIndex\Splitter\ISO_8859_1_Splitter\src
C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -IC:\python23\include -IC:\python23\PC /TcProducts/PluginIndexes/TextIndex/Splitter/ISO_8859_1_Splitter/src/ISO_8859_1_Splitter.c /Fobuild\temp.win32-2.3\Release\Products/PluginIndexes/TextIndex/Splitter/ISO_8859_1_Splitter/src/ISO_8859_1_Splitter.obj  ISO_8859_1_Splitter.c
fatal error C1083: 
Cannot open source file: 
'Products/PluginIndexes/TextIndex/Splitter/ISO_8859_1_Splitter/src/ISO_8859_1_Splitter.c':
   No such file or directory
error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe"'
failed with exit status 2

When I inspect
'Products/PluginIndexes/TextIndex/Splitter/ISO_8859_1_Splitter/src
I find only one file and its:
ISO_8859_64 (no extension).

  
  
From where did you obtain the Zope source code?  The file it's looking
for should be there.

For the heck of it, on WinXP I just downloaded Zope-2.8.0-a2.tgz from

http://www.zope.org/Products/Zope/2.8.0a2

then unpacked it using WinZip 9.0 SR-1.  No problems:  build_ext -i
worked fine, and:

C:\Zope-2.8.0-a2\lib\python\Products\PluginIndexes\TextIndex\Splitter\ISO_8859_1_Splitter\srcdir
 Volume in drive C has no label.
 Volume Serial Number is 5C0F-48E6

 Directory of C:\Zope-2.8.0-a2\lib\python\Products\PluginIndexes\TextIndex\Splitter\ISO_8859_1_Splitter\src

04/09/2005  06:49 PMDIR  .
04/09/2005  06:49 PMDIR  ..
04/02/2005  04:26 AM15,437 ISO_8859_1_Splitter.c
   1 File(s) 15,437 bytes
...

  

Tim,
Wow thats great. I'll do it all over again. Thanks for the tip (i
just reviewed my download using Ultimate Zip (which has been reliable
in the past) and the key files are missing. Odd.
David



___
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] Dynamic hyperlink with parameter

2005-04-09 Thread David H
srikanth wrote:
Hi,
 I am trying to execute something like:
  
tr tal:repeat=recordset
   td tal:replace=recordset/fnamea
href=eachrecordresult.html?fname='recordset/fname' First Name
/a/td
   td tal:replace=recordset/lname Last Name /td
   /tr

  Everything works fine but the hyperlink. What I want it to look in
the hyperlink is something like:
eachrecordresult.html?fname='chris' 
where eachrecord is separe ZPT which retrieves each persons
record and displays it.

   But how it interprets it is (each looks the same):
  eachrecordresult.html?fname='recordset/fname'
 How can I solve this problem.
Thanks in advance.
Srikanth.
___
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 )

 

Srikanth, just replace the range with your recordset, etc.  I think this 
should work.

table
  tr tal:repeat=number python: range(4)
  tda tal:attributes=href python: str(number)Link Stub/a/td
  /tr
/table  

David
___
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] Dynamic hyperlink with parameter

2005-04-09 Thread David H
srikanth wrote:
Hi,
 I am trying to execute something like:
  
tr tal:repeat=recordset
   td tal:replace=recordset/fnamea
href=eachrecordresult.html?fname='recordset/fname' First Name
/a/td
   td tal:replace=recordset/lname Last Name /td
   /tr

  Everything works fine but the hyperlink. What I want it to look in
the hyperlink is something like:
eachrecordresult.html?fname='chris' 
where eachrecord is separe ZPT which retrieves each persons
record and displays it.

   But how it interprets it is (each looks the same):
  eachrecordresult.html?fname='recordset/fname'
 How can I solve this problem.
Thanks in advance.
Srikanth.
___
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 )

 

Srikanth,
This is a better example, I tested it on my system against my Vendors 
file. 

table
  tal:block define=rec_set context/zVendorName
  tr tal:repeat=rec rec_set
  tda tal:attributes=href rec/vendorname
 span tal:replace=rec/vendorname/span
  /a
  /tr
  /tal:block
/table 

Anyway, it should be close to what your looking for I hope cause Im done 
now.

David
___
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] Windows compile Zope 2.8?

2005-04-08 Thread David H
Hi List,
I notice that the latest Zope does not have a Windows binary release yet 
(zope 2.80 alpha 2).

I found an old Visual C 6.0 (still in the box!) and wonder if there are 
instructions somewhere that I can follow to create my own binary on 
Windows XP?

Thanks, David
ps - Maybe I'm having a bad goggling day but couldnt find something 
useful.  I did see that Visual C is used often for this.



___
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] Does anyone care whether we deprecate Your Favourite Part of Zope

2005-04-07 Thread David H
Andrew Milton wrote:
I think people on this list need to realize that eventually, the direction of
any significantly large Open Source project is hijacked by the relatively
small number of people actually doing the work.
The reasons for this are many-fold, but, normally come down to a lack of
communication between the developers and the users, which is realized in a
lack of understanding by the developers of what the users want.
This for the most part isn't generally a problem, until, the developers start
to do things for the user's own good, like remove features that are
kludgey, or a hack, or insert some other reason, which generally means
either noone wants to work on it, or some other change caused it to break, and
noone wants to fix it.
Now to the credit of the Zope guys, they actually poll the users to find out,
rather than just announce the demise of something. However, in general once 
you add a feature, you can be guaranteed, that somewhere, someone is using 
it, so removing it will always cause a problem. So there will always be an
uproar when you poll.

You're never going to be able to reduce the feature set between point
releases without upsetting some group of people. So why don't we stop all this
nonsense now, and just agree, that you're never going to do that d8) You have
Zope 3 to remove all the stuff you hate d8)
In my opinion if you change something, it's your responsibility to fix the
resulting breakage. That's part of your responsibiliity to the rest of the
community (i.e. the [mostly non-paying] customers). If you don't think you
have this responsibility to us, then you should work on your own version of
Zope, where you're not impacting anyone else.
For the record, I hate ZClasses... d8)
 

I wish Terri Shiavo had as much compassion as ZClasses.
___
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] Multiple Browser Id Managers question

2005-04-05 Thread David H
Hi Zope List,
The current SESSION Chapter in the Zope Book 2.7 says the following:
 ... once you've instantiated one browser id manager or if you keep the 
default browser id manager, you will not be able to instantiate another 
browser id manager in a place where the new browser id manager can 
acquire the original browser id manager via its containment path

But I find that I *can* add additional Browser Id Managers in folders 
that can acquire the original browser id manager - without deleting the 
default copy in Zope root. 
Any thought ideas on this?  Does the principal still stand, e.g. Not 
good to put a browser id manager in a place that can also acquire 
another browser id manager?

Thanks,
David
___
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] SESSION invalidate method

2005-04-03 Thread David H
Hi List,
I am curious about the SESSION.invalidate() method.
This code sets a SESSION key and value and then calls SESSION.invalidate():
tal:block define=dummy 
python:request.SESSION.set('Dodgers','Baseball') /

p before invalidate /p
p tal:content=python: request.SESSION /
tal:block define=dummy python:request.SESSION.invalidate() /
p after invalidate()/p
p tal:content=python: request.SESSION /
Produces this output:
before invalidate
id: 11125588150079827980, token: 95966850A1xaz-gQYlU, contents: 
[('Dodgers', 'Baseball')]

after invalidate()
id: 11125588150079827980, token: 95966850A1xaz-gQYlU, contents: 
[('Dodgers', 'Baseball')]

It seems that SESSION.invalidate() does not take immediate effect. 

Seems like a developer could getinto trouble if the same script *both* does
SESSION.invalidate()
SESSION.set('something','somevalue').
Because after the script runs 'something' goes away when invalidate() 
finally
occurs.

And is the effect described above to be expected or do I have this wrong?
Thanks,
David

___
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] Re: SESSION invalidate method

2005-04-03 Thread David H
Sune B. Woeller wrote:
hi David,
I had the same problem, see this thread with a workaround,
and this bug report: http://www.zope.org/Collectors/Zope/1594
regards,
Sune B. Woeller
David H wrote:
Hi List,
I am curious about the SESSION.invalidate() method.
This code sets a SESSION key and value and then calls 
SESSION.invalidate():

tal:block define=dummy 
python:request.SESSION.set('Dodgers','Baseball') /

p before invalidate /p
p tal:content=python: request.SESSION /
tal:block define=dummy python:request.SESSION.invalidate() /
p after invalidate()/p
p tal:content=python: request.SESSION /
Produces this output:
before invalidate
id: 11125588150079827980, token: 95966850A1xaz-gQYlU, contents: 
[('Dodgers', 'Baseball')]

after invalidate()
id: 11125588150079827980, token: 95966850A1xaz-gQYlU, contents: 
[('Dodgers', 'Baseball')]

It seems that SESSION.invalidate() does not take immediate effect.
Seems like a developer could getinto trouble if the same script 
*both* does
SESSION.invalidate()
SESSION.set('something','somevalue').

Because after the script runs 'something' goes away when invalidate() 
finally
occurs.

And is the effect described above to be expected or do I have this 
wrong?

Thanks,
David

Sune,
Thats great! Thanks. 

My tests confirm this excerpt from Collectors/Zope/1594: 'The suggestion 
... to use context.session_data_manager.getSessionData() to get the 
session after the call to invalidate works - it gives me a new session 
object, and all is well :)'

David
___
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