Re: [Zope] Does anyone care whether we deprecate ZClasses?

2005-04-01 Thread David H
Andreas Jung wrote:

--On Freitag, 1. April 2005 16:52 Uhr -0500 Jake <[EMAIL PROTECTED]> 
wrote:

want to use them going forward, but what are the reasons why not to
support them as legacy into 3/2.10?

To avoid that people use ZClasses in the future :-)
-aj

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

The problem with ZClasses is that is was a very good idea.  Lots of us 
used them.  I did, but thru luck and caprice migrated toward Python Scripts.
I would recommend ZClass people should form a group.  And have good 
people keep the thing compatible with each Zope release.
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():


 before invalidate 


 after invalidate()

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 )


Re: [Zope] getting all fields from dynamic checkboxes

2005-04-03 Thread David H
Dan E wrote:
Hi,
Has anyone found a way to get a list of boolean values from
dynamically created checkboxes.
I have created a bunch of checkboxes within a repeat loop like this:

but when I access the cb_array from my python script, I only get the
checked values (and I can no longer match the values up with the
checkbox they came from).
any help on this would be appreciated.
thanks in advance,
Dan
Dan,
Not really sure if this is what you want.  But i've done stuff like:

  
  
 
   
 
 

When showRequest is called, it displays just the selected checkboxes like:
checkBox0'on'
checkBox2'on'
checkBox4'on'
checkBox7'on'
hth,
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():



 before invalidate 


 after invalidate()

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 )


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


Re: [Zope] Does anyone care whether we deprecate

2005-04-06 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 , 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] 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] 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\src>dir
 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 PM  .
04/09/2005  06:49 PM  ..
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:
  

   
href="eachrecordresult.html?fname='recordset/fname'"> First Name

Last Name 
   

  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.


  
  Link Stub
  
  

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:
  

   
href="eachrecordresult.html?fname='recordset/fname'"> First Name

Last Name 
   

  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. 


  
  
  
 
  
  
  
 

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] 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] 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 ?


 
   The title
 
 

TITLE OR ID

URL


 

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


 
   The title
 
 

TITLE OR ID

URL


 

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


URL

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

2005-04-20 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] 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] 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] 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


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


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





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] 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] 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
// .


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
..


  < see with 
javascript


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] 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:

or

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:



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 regarding
the decimals?  For now, I am just going to setup 2.3.4 and run with
it.
 

The Python decimal type 

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

2005-05-20 Thread David H
ArtÅras 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) 
(2)   
 Saved.
(3)  

.
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 [] ). #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.
Iâd 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).
ArtÅras
[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] 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  =   or 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 )


[Zope] DTML in Zope 2 vs Zope 3

2005-05-22 Thread David H

Hi,

I understand that DTML will be in Zope 3.  My question is, do 
"namespaces" and "context" also migrate to Zope 3? If not, could break 
existing code? 


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 Withers wrote:

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.



If this is coming from a spec, it's very silly, and a total waste of 
your time...


I've even turned down gigs because the client was stubborn and what 
they wanted would be a disaster. 



So you turned this one down, right?

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.



Oh? Do enlighten us... ;-)

Note:  Sometimes I sense a "culture clash" between Advanced Zope 
developement guys,



"people with brains"

Web presentation guys 



"people with too little brain to understand or care what usability 
really means" ;-)


and us lowly application developers that get the joy of accounting 
systems online.



"people who should know better but are too timid to speak" *grinz*


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



It's grim to debug, and 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"


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



There are many, but that's beyond the scope of this list...

cheers,

Chris


Hi Chris,
Yeah I really should put a representative model online. When I do I'll 
invite a new wave of assaults but its all for the good. 8-)   Because if 
people show me a better way for the kinds of apps I develope 
(accounting) then that would be great.
On the otherhand you may be surprised at what the "stateless" machine 
concept can accomplish - and how elegant it is. 


Thanks,
David

ps - your SimpleUserFolder Rocks!
___
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] 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:







   

  selected="true">

   




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  to 
 ?

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  to
 ?

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



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
	

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

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] 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] 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-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] 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] 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:


 
   The title


PUT CSS CODE HERE FOR GERMAN IMAGE


 

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:


 
   The title



PUT CSS CODE HERE FOR GERMAN IMAGE


 

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

2005-06-06 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  ... 
or 

Tito,

Thats the first example of that logic I've seen  Mixing CSS
parent-child dependencies and something like:
 

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] 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:


    
  whatever you do in the loop
  


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  around the loop and  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] ZPT tutorial

2005-06-20 Thread David H




Everyone,

I think the ZPT tutorials are excellent.  Both "Using Page Templates"
and "Advanced Page Templates" are worth reading more than once.  

David


Andreas Jung wrote:

  
--On 20. Juni 2005 23:45:34 +0100 John Poltorak <[EMAIL PROTECTED]>
wrote:
  
  
  
Does a ZPT tutorial exist anywhere?


  
  
Aren't the *three* ZPT chapters in the Zope Book good enough?
  
  
-aj
  

  




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




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] 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

javascript here



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:


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
}

[various html...]

[options...]


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 )


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


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


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


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 )


[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] 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 )


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= and
value2=
  THEN
  update table set(
  name=''
  )where value1=
and value2=
  ELSE
  insert into table values(
  Id,
  
  name='',
  
  value1=, 
  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] Presentations Available

2005-10-03 Thread David H

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?

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] 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] selected in select lists

2005-10-14 Thread David H

Garry Saddington wrote:


Tino Wildenhain wrote:


Am Freitag, den 14.10.2005, 20:03 +0100 schrieb Garry Saddington:
 


Chris Withers wrote:

  


Garry Saddington wrote:




DTML:


expr="groupabbrev==_.str(thisgroupabbrev)"> selected 
>



  


And just for comparison, here's the ZPT:


 


Stop using DTML ;-)

Chris




This code does not work;-). If I always work in the ZMI and do not 
collaborate with designers on database web applications where the data
is more important than the presentation, can you give me a good 
reason for not using DTML. I find DTML more intuitive than ZPT and 
once you get the hang of
the namespace magic thing it is not that bad. The ZPT code above 
seems to me more complex and it has defined two new variables, 
whereas the DTML only has two variables

and a string conversion.
Regards
Garry
ps. I would use ZPT if I could see a valid reason to do so.
  



The example above is unfortunatly a bit bad from app design view.
You should either do the comparison in your ZSQL Method
or wrap the call to the ZSQL method in a simple python script.

Then all your ZPT reduces to:


 Example 


Which is imho much better to read then the code above.
All you need to do is to deliver True/False, None/Something
for the "selected" field.
Not doing the comparison in your Template (no matter if DTML
or ZPT) really makes live easier.

You should try to get your Application right independend of
any HTML output. (e.g. you can call the scripts/ZPTs directly
to find out whats going on)

HTH
Tino Wildenhain



 

The comparison is dynamic. The user selects an option, that option is 
passed to a formhandler and hence back to the referring method.  How 
could I not do the comparison in this method? If it could be done in a 
python script as you say, why should I inject another layer of 
complexity into my application when the one dtml method will do the job?
imho such a problem as selected in selects should have a well 
documented solution as many developers will need it and why should 
each one have to find the solution for themselves?
I think Zope is the most important technology on the Internet at 
present, with the possibility to become really huge, but if every 
developer has to search so hard for solutions as I have had to, it 
will forever be a niche product.

regards
Garry

_


Garry,
You argue sucessfully re: DTML vs ZPT on some of the grounds you articulate.
Although the particulars of your app are not so significant.

Calls to python scripts hardly add complexity - its just the opposite..  
Have you noticed a simpler language than python?
An important  issue in my view - is something unexpected to new ZPT 
users:  superior design patterns - especially if you take advantage of 
Macros and Slots.


If you are mid developement i wouldnt suggest making the change now.  
But I do suggest you consider using ZPT when you can - maybe with 
simpler modules at first. 

BTW this very same dispute came up a few months ago and you might google 
for 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 )


[Zope] Linux/unix preferences question

2005-10-22 Thread David H

Hi List,

I want to soon move from Windox XP to Linux or Unix (intel/amd) for my 
Zope projects.  Just wondering if users experienced with these can 
recommend versions (freeBSD?, SuSe?, Red Hat?  etc)  that plays well 
with Zope and those to avoid.


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] question about stopping acquisition in VHM sites?

2005-10-27 Thread David H




Gary wrote:
On 10/27/05, Chris Withers
<[EMAIL PROTECTED]>
wrote:
  
  Gary
wrote:
> How do I stop acquisition at the root of my website?
> If I have two websites in zope, and I set the virtual host mapping
to
> www.sitea.com/websites/SiteA
 
> www.siteb.com/websites/SiteB
<
http://www.siteb.com/websites/SiteB>
>
> I don't want my users to get to SiteB from http://www.sitea.com/SiteB

Why not? How would they find a URL like that?


You can't do anything from the Zope side to stop this.
An Apache rewrite rule maybe? You'll need ot be clever mind...

http://www.sitea.com/somefolder/somesubfolder/SiteB/somesitebfolder/etc


...will still work.

Best bet? Don't sweat it, onyl worry about it if it really proves to be
a problem ,which it shouldn't be...

cheers,

Chris

PS: There's always Zope 3 ;-)

  
  
  
Thanks Chris,
  
I don't know how the URL got out.  But the web-bots are having so
much fun with my website right now.  :(
They are indexing everything for the wrong virtual host.  Maybe
robot.txt will stop them.
  
--
Gary
  


Gary,
Are these anonymous access sites?  If not then where are your users
defined?  BTW, im curious - how does Zope 3 otherwise solve this?
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] help - my zope build exits with compile errors :-(

2005-10-27 Thread David H

Thomas Wolf wrote:


Hi,

 I'm trying to build Zope-2.7.4-0 from source (I can't use a different 
version because of the releas of Plone we're

using.)  I ran
./configure --with-python=/usr/local/zope/python/bin/python 
--prefix=/usr/local/zope"
and that reported no issues.  BTW, I'm using python 2.3.5 - that's why 
I had to use the --use-python argument.


Then I ran make.  No reported problems for quite a bit into the build 
- then I get:


gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes 
-fPIC -I/usr/local/zope/python/include/python2.3 -c 
Products/PluginIndexes/TextIndex/Splitter/ISO_8859_1_Splitter/src/ISO_8859_1_Splitter.c 
-o 
/usr/local/zope/Zope-2.7.4-0/build-base/python-2.3/build-temp/Products/PluginIndexes/TextIndex/Splitter/ISO_8859_1_Splitter/src/ISO_8859_1_Splitter.o 

gcc: 
Products/PluginIndexes/TextIndex/Splitter/ISO_8859_1_Splitter/src/ISO_8859_1_Splitter.c: 
No such file or directory

gcc: no input files

Sure enough, there's no ISO_8859_1_Splitter.c file - but I haven't got 
a clue why not.  IS this generated by an earlier
part of the build and just didn't?  Or was there something missing 
from the tar ball (I got it off www.zope.org!)


Any help/suggestion would be much appreciated,
Tom

P.S. I'm trying to build this under Solaris 9 using gcc 3.3.2.


Thomas,

I seem to recall something like this.  I think the path + file name for 
sISO_8859_1_Splitter.o is *too long* for the extractor.


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] Zope 2.8.4 compilation error

2005-11-15 Thread David H

Gusti Gonzalez wrote:


Hi,

I am having the following error when compiling Zope:
---
"/usr/bin/python" "/infra/portal/Zope-2.8.4-final/setup.py" \
   build
--build-base="/infra/portal/Zope-2.8.4-final/build-base/python-2.3"
--build-lib="/infra/portal/Zope-2.8.4-final/build-base/python-2.3/build-lib"
--build-scripts="/infra/portal/Zope-2.8.4-final/build-base/python-2.3/build-scripts"
--build-temp="/infra/portal/Zope-2.8.4-final/build-base/python-2.3/build-temp"
running build
running build_py
running build_ext
building 'AccessControl.cAccessControl' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
-fPIC -IExtensionClass -IAcquisition -I/usr/include/python2.3 -c
AccessControl/cAccessControl.c -o
/infra/portal/Zope-2.8.4-final/build-base/python-2.3/build-temp/AccessControl/cAccessControl.o
En el fichero incluído de 
/usr/lib/gcc-lib/i486-linux/3.3.5/include/syslimits.h:7,
de /usr/lib/gcc-lib/i486-linux/3.3.5/include/limits.h:11,
de /usr/include/python2.3/Python.h:19,
de ExtensionClass/ExtensionClass.h:83,
de AccessControl/cAccessControl.c:51:
/usr/lib/gcc-lib/i486-linux/3.3.5/include/limits.h:122:75: limits.h: No existe
el fichero o el directorio
En el fichero incluído de ExtensionClass/ExtensionClass.h:83,
de AccessControl/cAccessControl.c:51:
/usr/include/python2.3/Python.h:28:19: stdio.h: No existe el fichero o el 
directorio
/usr/include/python2.3/Python.h:30:5: #error "Python.h requires that stdio.h
define NULL."
/usr/include/python2.3/Python.h:33:20: string.h: No existe el fichero o el
directorio
/usr/include/python2.3/Python.h:34:19: errno.h: No existe el fichero o el 
directorio
/usr/include/python2.3/Python.h:36:20: stdlib.h: No existe el fichero o el
directorio
/usr/include/python2.3/Python.h:39:20: unistd.h: No existe el fichero o el
directorio
/usr/include/python2.3/Python.h:46:20: assert.h: No existe el fichero o el
directorio
...
... and the error list goes on.
---

but the limits.h file does exist at the above mentioned location

My environment is:
Debian 3.1 (stable)

dpkg -l | grep python
ii  python 2.3.5-2An interactive high-level object-oriented la
ii  python-ldap2.0.4-1A LDAP interface module for Python. [dummy p
ii  python2.3  2.3.5-3An interactive high-level object-oriented la
ii  python2.3-dev  2.3.5-3Header files and a static library for Python
ii  python2.3-ldap 2.0.4-1A LDAP interface module for Python 2.3

dpkg -l | grep gcc
ii  gcc3.3.5-3The GNU C compiler
ii  gcc-3.33.3.5-13   The GNU C compiler
ii  gcc-3.3-base   3.3.5-13   The GNU Compiler Collection (base package)
ii  libgcc13.4.3-13   GCC support library

dpkg -l | grep make
ii  ant1.6.2-2Java based build tool like make
ii  libant1.6-java 1.6.2-2.1  Java based build tool like make -- library
ii  make   3.80-9 The GNU version of the "make" utility.
ii  makedev2.3.1-77   creates device files in /dev


Any ideas what can be missing from my installation?

Best regards,
Gustavo.


 


Gustavo,
Did you download the full (developers) version of python from 
python.org?  If not you'll need to to compile Zope.

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] Install Zope

2005-12-07 Thread David H

Harry Forster wrote:

I would like to install Zope 2.8.4 on a Suse 9.0 system.  Has anyone done this 
and how did you do it?


___
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.1315 (20051207) Information __

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



 


Forster,
Install Zope from source - get Zope 2.84 from zope.org/downloads.  Get 
python from python.org.  I just did wgets and went from there.  Google 
for linux zope installation docs.  I installed zope over Ubuntu doing 
this just a a few weeks ago.   It just takes some time - a few hours of 
extreme annoyance and then its a beautiful thing.

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] ZSQL batching with dtml-in

2005-12-08 Thread David H

Ed Colmar wrote:

Do ZSQL methods communicate with the dtml-in call and understand the 
"size" attribute?


for example, in this dtml-in statement:



Will the database be queried for all results, and only have 20 
displayed, or will the database just return the 20 that are needed?


Thanks for the insight!

-Ed
___


Ed,
Just add a "Z Search Interface" to a folder that can acquire your zSQL 
method(s).  I think it will create a sample of what you want to do in 
either ZPT or DTML.  Then you can experiment.


You can use the "advanced tab" to tell zSqL methods how many data 
records to download per get and how many to cache.


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] Simple User Folder Setup

2005-12-09 Thread David H




Infor Gates wrote:

   Dear zopist
  
I am having problems in setting up Simple User Folder.
Error Message:
  Error Type: UnconfiguredException
  Error Value: Addition of users has not been configured
  
  
I have googled around for an answer. However, there is very little info
on it.
My Configuration: Zope2.8.4 / Windows XP Pro / Postgresql
I have copied all  (addUser.pys, addUser.sql, editUser.pys
editUser.sql, deleteUser.pys deleteUser.sql, getUserIds.pys,
getUserIds.sql, getUserDetails.pys, getUserDetails.sql) into the
/TEST/acl_users/Contents page as advised in README.
  
Do anyone have similar experiences?
  
Thank you.
  
   
  

Infor,

Take a look at the source SimpleUserfolder.py.  That error occurs when
the method:

    def _doAddUser(self, name, password, roles, domains, **kw):

cannot acquire the method "addUser".

You should ensure that all methods (addUser, getUserDetails,
getUserName, etc) are either in the folder or acquirable by the folder
that you drop a Simple User Folder object in.

HTH,
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: live dtml updating?

2005-12-11 Thread David H

Jonathan wrote:

This is client side processing (could be done via repetitive calls to 
the server, but very inefficient), so you want a javascript-type of 
solution. Not a zope solution.


Trying googling 'javascript dynamic lists'... it should get you going 
in the right direction.


Jonathan


- Original Message - From: "Rich Harley" <[EMAIL PROTECTED]>
To: 
Sent: Sunday, December 11, 2005 5:31 PM
Subject: [Zope] Re: live dtml updating?



On Sunday 11 December 2005 22:30, you wrote:


> Hi all
>
> Sorry if this is not a specific zope question but I'm confident 
someone

> will be able to help me with the following.
>
> I have an input form on a webpage and below it a table which pulls 
out > of
> a database. The column headers in the table relate to the input 
form in
> that I want whatever the user types into the input box for the 
correct
> column to be highlighted in bold. So say, for example I had two 
columns > A
> and B I want column B to be highlighted bold when the user types 
'b' > into

> the input box

at

> the top. How can I do this?

Rich



--
www.horsey.tk


Rich,

Or you can try using CSS  + (javascript and DOM object style 
attributes).  Where you use javascript to give a 
document.someform.someInput.style the ID of an existing CSS style maybe 
"onBlur"  Not sure if it will do it all but its a place to look as 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 )


Re: [Zope] Re: live dtml updating?

2005-12-11 Thread David H

David H wrote:


Jonathan wrote:

This is client side processing (could be done via repetitive calls to 
the server, but very inefficient), so you want a javascript-type of 
solution. Not a zope solution.


Trying googling 'javascript dynamic lists'... it should get you going 
in the right direction.


Jonathan


- Original Message - From: "Rich Harley" 
<[EMAIL PROTECTED]>

To: 
Sent: Sunday, December 11, 2005 5:31 PM
Subject: [Zope] Re: live dtml updating?



On Sunday 11 December 2005 22:30, you wrote:


> Hi all
>
> Sorry if this is not a specific zope question but I'm confident 
someone

> will be able to help me with the following.
>
> I have an input form on a webpage and below it a table which 
pulls out > of
> a database. The column headers in the table relate to the input 
form in
> that I want whatever the user types into the input box for the 
correct
> column to be highlighted in bold. So say, for example I had two 
columns > A
> and B I want column B to be highlighted bold when the user types 
'b' > into

> the input box

at

> the top. How can I do this?

Rich




--
www.horsey.tk


Rich,

Or you can try using CSS  + (javascript and DOM object style 
attributes).  Where you use javascript to give a 
document.someform.someInput.style the ID of an existing CSS style 
maybe "onBlur"  Not sure if it will do it all but its a place to look 
as well.

David

Let me correct myself -  use "onBlur" to trigger JS + CSS and object 
style manipulation -

If interested or this sounds like what you want to do then go to:

http://www.quirksmode.org/

And check out the JavaScript/DHTML section.

Best,
David


re something like:

Re: [Zope] Simple User Folder Setup

2005-12-12 Thread David H




Infor Gates wrote:

  Chris
  
Thanks for your email. There is another person I wish to thank.
However, I lost his email contact by accident - his advice points me to
where to check for the errors.
  
Let me Simple User Folder works.
  
As I googled for some time on this, I noticed there are others who had
similar problems but the answer was not quite straight forward.   The
reason, my best guess, is most of us are "juniors" - slightly above a
beginner. As we journey to "higher" level Zope development, we tried to
grasp the concepts of the Products developed by people like you.
  
For me, when I installed the SUF according to the README file, it was
straight forward. I test individual programs and it is working OK.  I
copy LITERALLY the needed  *.pys and *.sql from test directory to
content page of SUF instance.
  
However, when I try through Zope TTW (e.g. ADD user), the system
produces the said error message.  "Juniors" like me wo uld expect the
SUF works the same as Zope User Folder. When it did not, I was lost.
  
Thanks to the an advice from the earlier email, I learnt to hack around
the example I copied to the content page of SUF instance. It was a
simple error BUT I did not see it. The example call for addUser but the
program copied was named addUser.pys. Also missing inside the example
is  calling the addUser.sql.
So when I change the name to addUser and added call to addUser.sql, it
work fine.
  
In conclusion, I would say it was a miscommunication or mis-reading of
the README. It would be better the README file can improve this aspect.
Then I believe everyone would enjoy using the SUF.
  
  
  
  
  Chris Withers <[EMAIL PROTECTED]> wrote:
  
Infor Gates wrote:
> I am having problems in setting up Simple User Folder.
> Error Message:
> Error Type: UnconfiguredException
> Error Value: Addition of users has not been configured
> 
> I have googled around for an answer. However, there is very little
info on it.

Urm? That's a pretty damn clear error message if you ask me ;-)
Did you read the readme.txt in SUF?

> My Configuration: Zope2.8.4 / Windows XP Pro / Postgresql
> I have copied all (addUser.pys, addUser.sql, editUser.pys
editUser.sql, deleteUser.pys deleteUser.sql, getUserIds.pys,
getUserIds.sql, getUserDetails.pys, getUserDetails.sql) into the
/TEST/acl_users/Contents page as advised in README.

Does it say just blindly copy them?
Where did you copy them to?

Those files are primarilly for running theses tests. If you read the 
python files in the tests folder you'll see how to use them.

In your case, you need to define a method called 'addUser' inside the 
Contents tab of your SUF instance.

Read the readme.txt to find out what that method needs to take as 
parameters and what it needs to do.

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
  
  

And SUF deserves enjoying.  Its simple, clean and to the point.  Thanks
Chris.

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] List within a list - how to use in a page template

2005-12-13 Thread David H




Paul Winkler wrote:

  On Wed, Dec 14, 2005 at 06:06:21PM +1300, Cameron Beattie wrote:
  
  
I am trying to get my head around representing a list in a page template.

Assume the following list:


  

  m
  

  

[[61282125371L, 1, 6, 0], [61282125379L, 1, 6, 0], [61282825240L, 6, 6, 0], 
[61282125378L, 1, 6, 0], [61282125374L, 1, 6, 0]


  

  m[0]
  

  

[61282125371L, 1, 6, 0]


  

  m[0][0]
  

  

61282125371L

i.e. m is a list where each member is itself a list.

How do I get a page template to render a particular item? Assume a function 
getem returns the list.

   

This code will produce four columns and five rows, with each populated by 
the list members. But what if I only want the first and third members in 
each case i.e. 2 columns and five rows?

I thought it would be something like tal:content="python:single[0]" but 
that gives me an unsubscriptable object error.

  
  
That's because, in your example, each time through the loop,
single is an int. Try indexing m instead.

  

I think all thats needed is a tal:condition (he wants to filter out
rows)

1)
3)    
4)    tal:condition="python: repeat.r2.number in (1,2,4)" 
5)    tal:content="r2">
6) 

Where 4 is not brain dead as in my example. 

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] List within a list - how to use in a page template

2005-12-14 Thread David H




David H wrote:

  
Paul Winkler wrote:
  
On Wed, Dec 14, 2005 at 06:06:21PM +1300, Cameron Beattie wrote:
  

  I am trying to get my head around representing a list in a page template.

Assume the following list:

  

  
m
  
  

  
  [[61282125371L, 1, 6, 0], [61282125379L, 1, 6, 0], [61282825240L, 6, 6, 0], 
[61282125378L, 1, 6, 0], [61282125374L, 1, 6, 0]

  

  
m[0]
  
  

  
  [61282125371L, 1, 6, 0]

  

  
m[0][0]
  
  

  
  61282125371L

i.e. m is a list where each member is itself a list.

How do I get a page template to render a particular item? Assume a function 
getem returns the list.

   

This code will produce four columns and five rows, with each populated by 
the list members. But what if I only want the first and third members in 
each case i.e. 2 columns and five rows?

I thought it would be something like tal:content="python:single[0]" but 
that gives me an unsubscriptable object error.



That's because, in your example, each time through the loop,
single is an int. Try indexing m instead.

  
  
I think all thats needed is a tal:condition (he wants to filter out
rows)
  
1)
3)    
4)    tal:condition="python: repeat.r2.number in (1,2,4)" 
5)    tal:content="r2">
6) 
  
Where 4 is not brain dead as in my example. 
  
David
  
  
  
  
  

Ok, its best to parse your list of lists in a python script.  You pass
a tuple (or array) of inclusionary index numbers.  It will return the
filtered list of lists  The problem with the try I gave before is that
*condition* is evaluated before *repeat*  :-0

So ...

# python script
# input:  a tuple named tup of index items to include in list of lists,
eg (1,3) and the list of lists
#example input:  listoflists = [[61282125371L, 1, 6, 0], [61282125379L,
1, 6, 0], [61282825240L, 6, 6, 0]]
#example tup: (1,3)

ret = []
for i in range(len(listoflists)):
  if i in tup:
    ret.append(x[i])
return ret

Then your ZPT is easy.

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] sessions in the presence of conflicts

2005-12-14 Thread David H

Dennis Allison wrote:


Zope 2.8.4, ZODB 3.4.2

I am still trying to resolve a "session variables in the presence of
conflicts" problem.  The observed symptom is that suddenly either some
session variables disappear or all session variables disappear.  In both
cases, Zope has raised a KeyError exception for the a particular session
variable because it is not present and an attempt was being made to access
it from the session.

The cause appears to be related to the presence of a conflict error and a
botched recovery, but the exact mechanism remains a mystery.

Zope equates a session object with a TransientObject.  For our instance,
that's fine, since our only TransientObject is a session.  For the general
case, I would have thought a SessionObject inheriting from TransiendObject
would have been used so that conflict resolution for sessions could be
easily specialized.

The conflict resolution for a TransientObject (that is, a Session Object)
is clearly suboptimal.  In the next paragraphs I'll review what is 
currently done and then propose a different approach which I am about to 
implement for our systems.  Comments, corrections,  and suggestions much 
appreciated.


_p_resolveConflict(self, oldState, savedState, newState) 

returns the state of the object after resolving different changes.  The 
arguments are:


  oldState   -- state of the object at the beginning of the current 
	 transaction (mutable)
  savedState -- state currently stored in the database.  This state 
was written after oldState and reflect changes made

by a transaction that committed before the current
transaction (immutable)
  newState   -- state after changes made by the current transaction 
	 (immutable)


The standard conflict resolution for a TransientObject resolves according
to the following rules:

  1.  if any of the states are invalid (that is, has a key '_invalid')
  return the invalid state.

  2.  if any any of the attributes ['token','id','_created'] differ then 
  there is a conflict, raise the conflict exception.


  3.  choose the state most recently modified, if possible.

  4.  otherwise, choose the state most recently accessed.

It seems to me that we can do much better for sessions because we know a
bit about the semantics of sessions.  A session object is a
dictionary-like object mapping key-value pairs.  Adding or deleting keys
or changing the value associated with a key are independent operations and
do not conflict unless the keys are duplicated in both the transactions.  
Any conflict resolution mechanism needs to be able to manage multiple keys
independently since the session object is modified as a unit.   In 
addition, new keys may be added and old keys deleted; any conflict 
resolution mechanism at the key level needs to be comprehend those 
operations.


A more session-friendly conflict resolution might use:

  1.  if any of the states are invalid (that is, has a key '_invalid')
  return the invalid state.

  2.  if any any of the states attributes ['token','id','_created']
  differ then there is a conflict, raise the conflict exception. 


  3.  order the newState and savedState by modification time (or if that
  cannot be computed, by access time).   

  4.  any key appearing in oldState's dictionary but not appearing in 
  both savedState and newState should be removed from all.  This 
  corresponds to a key-value pair being deleted in one of the 
  transactions.  Insertions will be managed automatically by 
  the updates.


  5.  beginning with the oldest, update oldState dictionary of key-value 
  pairs using the dictionary part of newState and savedState.  Return 
  oldState.


This does several things.  First, it captures independent key-value
changes made in both potentially conflicting transactions.  Second, it
provides a reasonable ordering for multiple (potentially conflicting)
key-value pair updates.  Third, it manages insertions and deletions to the
session variable set in the presence of conflicts.

Does this make sense?  I have yet to figure out how to map a
TransientObject "state" back to the object it represents, but it clearly
is possible.




 


Dennis,
Im only curious and this is no recommendation ... and I asked this on 
the list maybe a year ago (and got zero reponses)


Have you given "HappySession" a try?  Has anyone? I've never had a 
problem with it, but then its never been under much load and is no 
longer actively supported (least last time I checked).


I converted back and forth between Zope SESSION and HappySession (for 
reasons of  legacy code).  Their interfaces have just few differences, 
e.g., HappySession['this'] returns None (if 'this' is not a key) and 
SESSION raises an exception.  That type of thing.


HappySession  does not read/write to zodb (if I recall it stores session 
data in RAM (session) cookies).  I just do not know if its otherwise up 
to your r

Re: [Zope] Unauthorized exception when trying to access a list item

2005-12-14 Thread David H

Cameron Beattie wrote:

I am trying to access a value in a list. The script getDIDS_list is 
passed a list called listoflists:

list = listoflists
ret = []
tup = (0,1,2)
factortup = (1,2)
factor = 2
for i in range(len(list)):
#   1 == 1
 if i in tup:
   if i in factortup:
  x = list[i] * factor
etc

The code is a bit strange due to my testing. However zope gets upset 
when trying to evaluate list[i]:


You are not allowed to access '1' in this context

a.. Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__
__traceback_info__: context.getDIDS_list(listoflists = DIDs)
a.. Module Python expression "context.getDIDS_list(listoflists = 
DIDs)", line 1, in 

a.. Module Shared.DC.Scripts.Bindings, line 311, in __call__
a.. Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
a.. Module Products.PythonScripts.PythonScript, line 323, in _exec
a.. Module None, line 10, in getDIDS_list

Line 10
a.. Module AccessControl.ZopeGuards, line 71, in guarded_getitem
a.. Module AccessControl.ImplPython, line 529, in validate
a.. Module AccessControl.ImplPython, line 329, in validate

I've tried calling the script from the page template using 
here.getDIDS_list, container.getDIDS_list context.getDIDS_list but the 
problem persists. Am I accessing the list in the wrong way? Any advice 
would be appreciated.


Regards

Cameron


Whats in your list?  A protected item?  Does this happen everytime or 
just with '1'? 


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] zyncer 0.7.0?

2005-12-17 Thread David H

Hi List,

I downloaded  zsyncer-0.7.0  and am having problems.  Its not working 
for me and it no longer displays prompts for destination password and 
user name when clicking its  tab.   Anyone else seeing this?


More importantly, as a fall-back is there a version (0.6.1?) others 
recommend?


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] zyncer 0.7.0?

2005-12-17 Thread David H




Alan Milligan wrote:

  -BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

David H wrote:
  
  
Hi List,

I downloaded  zsyncer-0.7.0  and am having problems.  Its not working
for me and it no longer displays prompts for destination password and
user name when clicking its  tab.   Anyone else seeing this?


  
  You need to use extended url auth syntax:
http://username:[EMAIL PROTECTED]/bla ...

This is because we can have multiple targets all with different
passwords ...

Alan

  

Alan,

Thanks for your response.  Apparently my
bin/zopectl stop / restart sequence was not
working on my remote (zettai) instance.
I had to do a shutdown from the control panel and *then* a bin/zopectl
start worked just fine - and zyncer came up as it should. The install
of zsyncer 0.7.0 on my *localr* system was fine - hence the disconnect
in what I was seeing ...

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: [Zope-dev] Re: sessions in the presence of conflicts

2005-12-19 Thread David H

Dennis Allison wrote:

Chris McDonough identified a persistence problem with the routine(s) that 
manage sessions variables.  (Thanks Chris)  I have put the correction in 
place which resolved some (but not all) of the problems.


There are still problems which are apparently due conflicts in accessing
the session variables.  To minimize frequency of conflicts, I am rewriting
several routines using Dieter's rules of the thumb (Thanks Dieter).

One routine being modified is a Script(Python) that initializes a number
of session variables.  I am collecting the session values in a dictionary
and then use update to set their value, for example:

s = {}
s['alpha'] = 'a'
s['beta'] = 'b'
request['SESSION'].update(s)

Is the persistence machinery smart enough to detect this as a change?  I
suspect that it has to be flagged since the assignment won't be seen.  
Usually this means setting the _p_changed=1 attribute, but it is not clear
to me where to set it in this particular context.  







 


Dennis,

Did you means request['SESSION']['someDictionary'].update(s)?
Anyway your idea seems correct - The SESSIONS chapter (at least on 
plope.com) addresses SESSION "staleness" and mutable objects.


1) someDict = SESSION['someDict']
2) someDict['someKey'] = "newValue"

But (2) does not guarentee that a subsequent lookups like:
SESSION['someDict'] will return "newValue".

But this WILL:
3) SESSION['someDict'] = someDict.

Which looks like your example.  How this connect to your primary issue:  
*conflicts* is not clear to me.  :-\


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: [Zope-dev] Re: sessions in the presence of conflicts

2005-12-19 Thread David H




Dennis Allison wrote:

  The interaction between sessions, conflicts, and persistence is a bit
confusing.  I am still trying to understand the code in depth.  

One thing is for sure, request.SESSION and/or request['SESSION'] must be
persistent for things to work.  Mutable objects in the session variable
set (dictionaries and lists) have to be handled specially to get the
persistence machinery to recognize they have been changed.

In this case, I am trying to ensure that the session variables get 
identified as persistent.  My question is whether using update (an 
implicit assignment) triggers the persistence mechanism.  It is the 
moral equivalent of writing 

	request['SESSION']['alpha'] = 'a'B
	request['SESSION']['beta'] = 'b'

but I am unsure whether the persistence mechanism will recognize it as 
such.  

Doing session variable initialization in a Script(Python) object has a
downside because one cannot set a _p_changed attribute and so must rely on
the assignment paradigm.  Perhaps the interface should be in a Product or
External Method which is less constrained.

Anyhow, David, thanks for the assist.


On Mon, 19 Dec 2005, David H wrote:

  
  
Dennis Allison wrote:



  Chris McDonough identified a persistence problem with the routine(s) that 
manage sessions variables.  (Thanks Chris)  I have put the correction in 
place which resolved some (but not all) of the problems.

There are still problems which are apparently due conflicts in accessing
the session variables.  To minimize frequency of conflicts, I am rewriting
several routines using Dieter's rules of the thumb (Thanks Dieter).

One routine being modified is a Script(Python) that initializes a number
of session variables.  I am collecting the session values in a dictionary
and then use update to set their value, for example:

	s = {}
	s['alpha'] = 'a'
	s['beta'] = 'b'
	request['SESSION'].update(s)

Is the persistence machinery smart enough to detect this as a change?  I
suspect that it has to be flagged since the assignment won't be seen.  
Usually this means setting the _p_changed=1 attribute, but it is not clear
to me where to set it in this particular context.  

  

  
  
  
  
Dennis,

Did you means request['SESSION']['someDictionary'].update(s)?
Anyway your idea seems correct - The SESSIONS chapter (at least on 
plope.com) addresses SESSION "staleness" and mutable objects.

1) someDict = SESSION['someDict']
2) someDict['someKey'] = "newValue"

But (2) does not guarentee that a subsequent lookups like:
SESSION['someDict'] will return "newValue".

But this WILL:
3) SESSION['someDict'] = someDict.

Which looks like your example.  How this connect to your primary issue:  
*conflicts* is not clear to me.  :-\

David



  
  
  

Dennis,
Lets just put the question out there:  Does:

SESSION['someKey'] = someValue

Force a commited transaction?

As opposed to ...
someDict = Session['SomeKey']
someDict['aKey'] = 'aNewValue'

David


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] Change ZSQLMethod connection id

2005-12-23 Thread David H

Andreas Jung wrote:




--On 23. Dezember 2005 13:33:08 +0100 Fabio <[EMAIL PROTECTED]> 
wrote:



Hi!
in my zope application I call ZSQLMethods from python script. Is it
possible  to set "connection id" property of a ZSQLMethod before call 
it?


How?
ZSQLMethod.propertyItems() return only ('title','')



perhaps

zsql_method.connection_id = '' might to the job. See DA.py

-aj

 


Fabio,

This, I think, is something I found in ZopeLabs some time ago. 
-

objs = container.ZopeFind(container,
 obj_metatypes=['Z SQL Method'],
 search_sub=1)
# module:  pyPsycopgPropertyChanges
path_list = []
for path, method in objs:

  title = method.title
  conn_id = 'Psycopg_database_connection'
  args = method.arguments_src
  body = method.src

  method.manage_edit(title, conn_id, args, body,max_rows=5000)
  path_list.append(path)

header = "Fixed up the following methods - %s out of total sql count of 
%s"%(str(len(path_list)), str(len(objs)))

body="%s"%join(path_list, '')
return header+body
-
HTH,
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] Javascript obfuscator and Zope

2005-12-29 Thread David H

Hi list,

I am wondering if anyone is obfuscating JavaScript  using a python 
script or product.  I did some googling but nothing cropped up.  Seems 
like a nice idea unless the  realities of javascript obfuscation make 
the exercise pointless.


Any thoughts?

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] Javascript obfuscator and Zope

2005-12-29 Thread David H

Jens Vagelpohl wrote:



On 29 Dec 2005, at 23:45, David H wrote:


Hi list,

I am wondering if anyone is obfuscating JavaScript  using a python  
script or product.  I did some googling but nothing cropped up.   
Seems like a nice idea unless the  realities of javascript  
obfuscation make the exercise pointless.



That exercise is pointless no matter what technology you use to  
implement it. What is your supposed use case, why do you think it  
makes any sense?


If you need processing that cannot be tampered with from the client  
side then pure server-side coding is preferable.


jens

_


Jens,

Thanks for the reply.  I kinda suspected the hostility to the idea.
Anyone else?

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] Help with Zope Python result object please!

2005-12-30 Thread David H




Alric Aneron wrote:
hello,
I have a python code that recieves two result objects from two
different ZSQL methods.  I need to join them (sort of like UNION).
I can't do result1+result2, otherwise it raises an exception that the +
operator isn't supported.
When I try to do this (read below, I explained what i've done if you
are lazy to read the code)
result1 = context.zsqlmethod1()
result2 = context.zsqlmethod2()
if (len(result1) == 0):
    return result2
row1 = 0
row2 = len(result1) + 1
col = 0
for r in result2:
   col = 0
   if (context.duplicateExists(result1, result2[row1][0]) == -1):
   result1[row2][col] = result2[row][col]
   col = col + 1
   row1 = row1 + 1
   row2 = row2 + 1
  
return result1
  
Basically, it loops through the rows and columns of result2 and adds
them to the end of th e result 1.  However it for some reason raises
"index out of range" and says that assigning
result1[0][0]=result2[0][0] (if there is an element in both of them) is
illegal because:
  Error Value: object does not support item or slice assignment
  I realize that in most programming languages you can't add
them to result1 without resizing it first, but I can't find much
documentaiton on member functions of the result object, so I can't
resize it.  
I am completely stuck, I've tried everything, spent so much time on it,
can anyone please help save my sanity :P
  
Thanks in advance guys! I really appreciate it.
   
   Y
Alric,
The merging of two zsql result sets is easy - here's one way:
newResults = []

for r in resultset1:
  newResults.append( r )

for r in resultset2:
  newResults.append( r )

return newResults.

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] Java vs Zope

2006-01-03 Thread David H

Asad Habib wrote:

From my experience, Java development has been a lot faster when 


applications have middle to high level complexity. Since Java is 
inherently object-oriented, reusability is much easier to achieve then 
when using Zope. Also, Java has mature development and debugging 
environments and well organized API's. Zope is seriously lacking in 
this regard.


Zope is good for building simple interfaces but any application that 
does data processing and requires session management should be left 
for Java. The closest comparison to Zope that I can think of is PHP.


Again, this is just my opinion based on my own experiences.

- Asad


Asad,

Python is also object oriented.  In python, x = 10 creates an object not 
a simple type - if I recall the same is true in Java.


The comparison should first be between python and java.  I've used both 
and prefer python.


The next compare should be between developement platforms for each: e.g. 
Zope vs some java IDE.


Lastly, I think Zope is more than capable of handling "complex 
applications" using external databases.  I've not run into a single 
barrier doing this using Zope (other than fleeing braincells).


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] Javascript obfuscator and Zope

2006-01-04 Thread David H

Jean-Marc Orliaguet wrote:


Peter Bengtsson wrote:


It's not a Zope product but at least it's python.
http://www.issuetrackerproduct.com/Download#slimmer

It's basically a javascript whitespace optimiser
Compare
http://real.issuetrackerproduct.com/tw-sack.js
with the original:
http://www.issuetrackerproduct.com/tw-sack.js

More work can be done of course but I wanted to keep it relatively 
CPU fast.

It works on CSS and HTML too:
http://www.peterbe.com/stylesheet.css

 



there is "minjs" written in C too: 
http://www.crockford.com/javascript/jsmin.html


this is a one-way process though, and this should also be compared 
with the effect of compressing files while serving them.


/JM


Thanks Peter and Jean-Marc!
I'll take a look at these.
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] Change object/role permissions w/ python?

2006-01-05 Thread David H




John Toews wrote:
Hi all,
  
I have a need to restrict anonymous access to an object until after a
specific action occurs. For example, the View permission by default is
restricted to owner and manager, but after a 'release' flag is checked,
it is viewable to anyone. I can't seem to find a way to do this
programatically, after googling for a few hours over the past few
weeks. Is it possible? I think the user running the action would need
'change permissions' rights... is there anyway to override that?
  
Thanks again!
John
  



John,

Here's a solution that at best will stimulate a better answer :-)


 tal:condition="python:  request.get(releaseFlag,0)">some link

or

 tal:condition="python:  not request.get(releaseFlag,0)">some
other link



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] Cookie Crumbler

2006-01-06 Thread David H




Dieter Maurer wrote:

  Infor Gates wrote at 2006-1-4 20:14 -0800:
  
  
I have a trying time using Cookie Crumbler 1.2 with Zope2.8.4 (windows version).
I could NOT figure out how to log out a user.  I have simplified to the orginal logged_out form to this:

  
  
The "Cookie Crumber" has a "logout" method.
You should use it for the logout (and not try to emulate it yourself).

You can activate it via an URL of the form:

url_to_your_cookie_crumbler/logout

It will redirect to the "logout_page" (you can configure for
your "Cookie Crumbler".


  

Infor,

you can also do it with a python script like so: (I make a python
script into index_html and use it as a request clearing house):

if request.get('action_type')  == 'LOGOUT':
   context.cookie_authentication.logout()

I guess you can translate this into DTML with something like:



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] Zope 2.8.5 install

2006-01-06 Thread David H




Robert Conner wrote:

  Hi, I'm trying to install 2.8.5 on my windows machine.

I do not have Visual C++ or .NET. Is there any way to compile are
install Zope with any sort of free software available?

Thanks,
Rob Conner
  
  

  


Robert,

This is just an alternate solution ...

I got Ubuntu Linux (recommended by some Zope listers (thanks!)) and it
installed perfectly on my Dell Windows XPS the first time I tried it. 
I had it partion my  primary drive and I  can  now boot either Windows
and Ubuntu Linux. 

I then had the joy of compiling from source - (1 minute of joy spread
over 3 days - but at least I didnt have to buy dinner).

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] Leave the ivory tower now!

2006-01-08 Thread David H




Jonathan wrote:

  
  
  
  To pour fuel on the flames...
   
  +1 DTML
  -1 ZPT
   
  Why...
   
  1) For 'quick and dirty' demos and
rapid application prototyping DTML does the trick (yes, even including
ZClasses), it is fast, easy, reasonably robust and it works!
   
  2) For 'heavy lifting' (ie. intense
computation, high loads, etc.) I prefer a 'product' approach.
   
  3) For client-side
functionality/control I prefer an
AJAX approach using a combination of _javascript_/HTML/XHTML/XHTML-MP
plus server-side python scripts/external methods/products.
   
  ZPT is a bit of a hybrid
which increases overhead and doesn't really bring any new functionality
to the table (for my applications and environment).  Yes, for
separating (well, mostly separating) content from display formatting
ZPT is one possible solution, but the divorce of content and
presentation is better achieved with an AJAX type of approach.
   
  I think Zope beginners would be
better off using DTML (easier to learn, user's get quicker results and
therefore have more satisfaction with Zope as a development platform),
and then 'serious' development should be done using an AJAX approach
with Zope 3 - the way of the future imho :-)
   
  If we had to make a choice for the
future I would prefer Zope 2 + DTML and Zope 3 + AJAX (and consign ZPT
to the 'good idea at the time' bin).  Possibly, in the distant future,
AJAX utilities/ides will exist which will make rapid prototyping and
'quick & dirty' demos feasible, in which case Zope 2 + DTML could
fade into happy history.
   
  Just my 1-1/2 cents.
   
   
  Jonathan
   
  
-
Origin
  


Think about it:  we argue about Z Classes vs DTML vs ZPT + python
scripts vs Products.  Its all good.

Zope + 1
  
 :-) 

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] Help me!

2006-01-09 Thread David H

Bruno Grampa wrote:


Hello,
i'm building a site to sell images (this is the concept, the reality is
different...).
All the images are in a directory mapped through LocalFS product.
For every image i have a record in a SQL table with all the basic
informations: author, name of the file, cost.

What i haven't understood is how to block users from getting images if
they have not enough credit to buy them.
I need to control the view method, but i don't know if this idea is the
right one or there are better solutions.

Any hints?

Thanks,
   Bruno





Bruno,

Maybe you can better explain your question. Im not at all sure the 
following will help:


Seems like you can check a users credit at login, store the credit score 
in SESSION and use that for branching logic.  You could also update the 
creditScore as it changes.


Then you can develope your pages with stuff like this:  (syntax not checked)

in TAL

This link only shows up if session's 
'hasCredit' is true.


In DTML




In Python: (and TAL macros)

  if context.REQUEST.SESSION['hasCredit']:
return container.Images.macros['allImages']  
  else
return container.Images.macros['someImages']  


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] CPU architecture and Zope

2006-01-09 Thread David H

Hi list,

Im just wondering what the wisdom is about Zope performance and various 
CPU types.  I'm running Zope on Linux (Ubuntu). I notice that Dell is 
selling  a "dual-core" Pentium unit.  But I have no idea if something 
like "dual core"  is advantegous to Zope, python execution or one's 
favorite RDMS.



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] newbie dtml-in question objectValues

2006-01-10 Thread David H




Alric Aneron wrote:

   Hello,
I am trying to find how to get the relative path of an object.  If i do:

   

  
URLPATH0 does not give me the relative path of the objects interated,
but rather the path of the object doing the iterating (my method). I
want the path of every DTML Document the loop encounters.  absolute_url
works, but it puts in the undesired filename and "http://" in front
etc. 
  
Thanks in advance!
Al
  
   
  
Alric,

This is a python example.  I dont want to convert to dtml but maybe you
do.

for o in container.objectValues('DTML Method'):
   print o.virtual_url_path()

return printed



___
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 do this trick..

2006-03-27 Thread David H

Jason C. Leach wrote:


Hi,

I'm wondering how I can do this little trick (sp_info is a globaly 
devide var, it's a dictionary obj):


tal:attributes="onmouseover string:doTooltip(event, 
'${sp_info/${group}/common_name}')" 
   onmouseout="hideTip()">



So based on my the value of 'group' from my repeat, I want to use the 
value to look up another value in a different dictionary.  It works if 
I do this:  (event, '${sp_info/whatever/common_name}') but does not 
like me using the embedded ${group}.


Thanks,
Jason.


Hi Jason,

I didn't know you could nest ${} objects in a string: construct.

You might make life easier using python.  Maybe something like:

tal:attributes="onmouseover python: sp_info[ group ] + '/' + common_name"

I have no idea what "common_name" is supposed to be, here I assumed its 
a global var.


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: Question about Zope and security

2006-03-29 Thread David H

Cyrille Bonnet wrote:


Hi Terry,

thanks for your comment.

Stock Zope doesn't use cookie authentication, so you're actually 
talking about
an alternate user folder product (which you don't specify and I don't 
know that
many of them, so I can't really comment much -- except that 
SimpleUserFolder
with CookieCrumbler will indeed put you in this situation (or did the 
last time

I checked)).



I am using Plone 2.1.2, which uses CookieCrumbler. I wanted to put the 
problem in a Zope perspective, though: this is why I didn't mention that.




The fact that Zope stores passwords as plain text is not the issue if 
you're worried
about man-in-the-middle attacks, though. The problem there is that 
you are passing
passwords plain text in the request, and there is almost no way 
around that unless you run an SSL (HTTPS) server.  Which you should 
if you want real security.




Sorry, I wasn't even aware that Zope stores the passwords in plain 
text.  My primary concern (for the moment) is passwords in plain text 
in the request.


I had thought of SSL, but it doesn't solve the problem for WebDAV access.

I should also mention that the site is for the general public, with a 
few users logging in.


Of course, I can't put the public site on SSL, so I would have to have 
a separate URL for logged-in users with SSL. And I still have to worry 
about the ZMI and WebDAV access.


It seems so much simpler to solve the problem at the root: change Zope 
authentication.



Encrypting your password database without moving your server login to 
HTTPS
is only going to create inconvenience without improved security (you 
can no
longer send password reminders, for example) -- it's a false sense of 
security.




Ouch, so on top of my concerns, passwords are stored in plain text?? 
Thanks for pointing that out.


I'd rather encrypt passwords with a hash and reset the password if the 
users have lost it. Is it possible to do that in Zope?


Obviously, I don't understand the ins and outs of Zope as well as most 
people on this list. So, my questions really are:


* why is Zope authentication implemented that way?
* Is it really complex to secure the authentication process?
* Is there any documentation summing up Zope security (authentication 
process, password storage, etc.)?


Cheers,

Cyrille

___


Cyrille,

I am curious:  If HTTPS is a hassle, then what do your security experts 
have as a secure alternative?


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] single sign-on

2006-04-02 Thread David H

robert rottermann wrote:


Fernando Martins wrote:


Hi,

I'm doing single sign-on using Apache+mod_ntlm+FastCGI. Since the 
last is

deprecated, is there any alternative?

TIA,
Fernando Martins

___
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,
during the next 4 weeks we will be prototyping a site.
One of the request we have to meet is SSO using
Active Directory to manage the users. One of the request
we *should* meet (I declined to commit ourselfs for this feature)
is that a user when logged into Windows she is automaticaly logged into
Plone. The server is running on a Linux box (SuSE 9.3 or later)
No idea yet whether this is possible yet, and I have read all related 
info with interest.

If you like we can try to join forces.

Robert


_

 


Robert,

You can python + COM your way to a browser startup zope/plone login 
screen.  I cannot see how you automate the authentication of a given 
browser instance that is then handed to your users.


Maybe someone will correct this.  If so everyone's happy.

Of course, you could make your plone site anonymous if you feel your 
secure by the time they get there.


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 include a local html file

2006-04-07 Thread David H

Chris Purves wrote:


Hello,

How can I include an html file on my local filesystem into a DTML method?


 


Chris,
You have asked a two part question.

a) how to access your local file system

http://sourceforge.net/projects/localfs

and b) how to access it in a DTML method

Dont know cause I havent used (a) but i'm sure you will see examples if 
you have (a).


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: zope 2.8.6 on Mac Intel

2006-04-13 Thread David H




Dieter Maurer wrote:

  manuel spuhler wrote at 2006-4-12 21:40 +0200:
  
  
...
 File "/opt/Zope2.8/lib/python/ZODB/__init__.py", line 21, in ?
   from persistent import TimeStamp
 File "/opt/Zope2.8/lib/python/persistent/__init__.py", line 19, in ?
   from cPersistence import Persistent, GHOST, UPTODATE, CHANGED, STICKY
ImportError: Inappropriate file type for dynamic loading

  
  
Something is wrong with your "cPersistent.so" file.

   It should be a dynamically loaded shared object but somehow it is not.

I cannot tell you why...


  

Manuel,

Last time I saw cPersistent.so mentioned as a problem it had to do with
conflicting python versions.  No idea either, otherwise.  
Did you mention your zope version *and* the python versions you are
using?  (check your control panel) Didnt see the start of this thread.

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] REQUEST.form variables order

2006-04-20 Thread David H




Gaute Amundsen wrote:

  On Thursday 20 April 2006 15:46, Tino Wildenhain wrote:
  
  
Gaute Amundsen schrieb:
...



  The order of the form elements that goes into mail headers is ofcourse
irelevant. I'ts the rest of the form, you know name, adress, street, etc.
that are the problem.
It's a purely visual thing, but when you have a form with perhaps 50
fields, that the client has carefully grouped and ordered, they can get
rather pissed if you try to tell them they can only have it in
semi-random or alpabetic in their mail.
  

...



  A smiley or two helps, but now I would say you are bordering on arrogant.
What more do I have to explain to convince you that I understand what the
problem is?
  

We would have saved time if you provided the very usefull information
first :-)


  
  Well, it's amazing how what seems clear to one can be quite opaque to another.
I will try to be more explicit next time.

  
  
Now you are building some kind of table/list with
form-field-name: form-field-value  - am I right?

how is it supposed to handle checkboxes, radiobuttons
and select fields?


  
  Hm.. I can't recall how I did that. I just made a reiplemetation of how 
formmail.pl did it.
But anything it does, it does looping thru request.form, so I dont think this 
is relevant. 

  
  
One possible workaround, if you dont want to touch
ZPublishers form handling would be to run a script
to not only update the forms target (formmail.pl -> zopeform)

  
  
I use apache "proxy rewrite" for that, no update needed.

  
  
but split every form element from


into




which you easily get as list of name/value pairs in
the form variable "body".

You can even make this transformation any time a user edits
her HTML source - save the users source in a property and
transform this source via some regex or HTML parser
to what you really want here.

Moderate work and you can even add some sanity checks :-)

If you can provide some typical samples of the HTML you
are facing I believe you even can get help with the
transformation script.

Regards
Tino

  
  
I have considered a number of variations along these lines.
Extracting the ordering information and adding a hidden field is also a 
posibilty. 
But the potential for messups, and big pain, with a script altering large 
amounts of user content, is not inconsiderable I would say.

I still think my own idea of adding a small proxy to transparently add that 
"hidden field" is rather more elagant.

I expect I will go with Andrew Milton's idea however, since that keeps us 
inside zope, and seems simpler to implement.

I would have prefered to go to the root of the problem, that allways works 
best in the long run, but it seems I have managed to avoid the effort this 
time. 

I still think it is something zope should handle, but for me it is only a sort 
of medium-term stop-gap measure, so it will do.

Thanks for your attention :)

Gaute
  

Hi Gaute,

I saw this in a Goodman _javascript_ book "Elements:  A collection of all
elements w/in a form ... Collection members are sorted in source code
order".  So, you could standardize a _javascript_ 
function that loops thru the elements naming each one?  

If such a thing could work that you just need to include the
../_javascript_. 

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] Process uploaded text file.

2006-04-26 Thread David H

Jason C. Leach wrote:


Hi,

Does anyone have an example (URL is fine) on how to processes a text
file via a Python script that has been uploaded from a web form?

Thanks,
Jason.

-


Jason,
Maybe this will help:

http://www.zopelabs.com/cookbook/1006887320

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] cooked body??

2006-05-10 Thread David H

David Bear wrote:

I'm attempting to use a zpt to read/render an html file. Just using 
something like


 stufff 

puts the 'escaped' contents of the file.html in the div section. I 
seem to remember something about cooked body or uncooked to get the 
non-rendered contents of the html file.


any pointers?

--
David Bear
What's the difference between private knowledge and public knowledge?


David,

Maybe "tal:content="structure here/htmlfolder/file.html"> ?  I use the 
"structure" key word to include things like CSS, and (python) 
dynamically generated JavaScript - maybe it will work fo you in this case.


David H






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