Re: [Zope] How to make a ZPT-based form that calls itself? (Part II)

2005-05-18 Thread Paul Winkler
On Wed, May 18, 2005 at 07:32:29PM -0400, Ken Winter wrote:
> The difference between this and the deletion example is that this form
> (personform.htm) need to be called with an argument, giving the person_id
> that identifies the record it is supposed to display.  I have tried a number
> of ways to sneak this argument in, but my limited experience with
> Zope/Python syntax has left me unable to guess the right trick.

You can append it to the url as a query parameter.
e.g.:

response.redirect('some_page?some_parameter=%s' % some_value)
 
-- 

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] How to make a ZPT-based form that calls itself? (Part II)

2005-05-18 Thread Ken Winter
In Part I, J Cameron Cooper showed me how to write a ZPT-based form that
displayed a list of database records and gave the user a chance to delete
one of them, after which the form redisplayed itself with a refreshed list
that reflected the deletion just performed.  The core of this was this
Python script, which was called by the form and which called a Z SQL method
to do the deletion:

id = context.REQUEST.get('person_id')
if id:
   container.delete_person(person_id=id)
context.REQUEST.RESPONSE.redirect('deltest.htm')

Now what I need to do is implement a record update form.  This form displays
all the columns of one database record.  The columns values are shown in
text input fields.  The user can write new values into these fields and push
a submit button, which calls this Python script:

id = context.REQUEST.get('person_id')
if id:
   container.update_person(\
  person_id=id,\
  first_name=context.REQUEST.get('first_name'),\
  middle_names=context.REQUEST.get('middle_names'),\
  last_name=context.REQUEST.get('last_name'))
context.REQUEST.RESPONSE.redirect('personform.htm')

This performs the update OK, but instead of redisplaying the page it gives
me:

Site Error
An error was encountered while publishing this resource.
Error Type: AttributeError
Error Value: person_id

The difference between this and the deletion example is that this form
(personform.htm) need to be called with an argument, giving the person_id
that identifies the record it is supposed to display.  I have tried a number
of ways to sneak this argument in, but my limited experience with
Zope/Python syntax has left me unable to guess the right trick.

- Thanks for your help, Ken


> -Original Message-
> From: J Cameron Cooper [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, May 11, 2005 5:52 PM
> To: [EMAIL PROTECTED]
> Cc: zope@zope.org
> Subject: Re: [Zope] How to make a ZPT-based form that calls itself?
> 
> Ken Winter wrote:
> >>-Original Message-
> >>From: J Cameron Cooper [mailto:[EMAIL PROTECTED]
> >>Sent: Wednesday, May 11, 2005 4:27 PM
> >>To: [EMAIL PROTECTED]
> >>Cc: zope@zope.org
> >>Subject: Re: [Zope] How to make a ZPT-based form that calls itself?
> >>
> >>Ken Winter wrote:
> >>
> >>>Hi Zopers -
> >>>
> >>>I'm trying to make a ZPT-based HTML form that:
> >>>
> >>>1. Displays the records in a MySQL 'Person' table;
> >>>2. Offers a field for updating this table (in my simple test example,
> it
> >>>accepts the Id of a Person to delete);
> >>>3. When you push its 'Submit' button, updates the database; and then
> >>>4. Automatically redisplays itself, showing the updated 'Person'
> >>
> >>records.
> >>
> >>>After a lot of help from the folks on various Zope lists, I've made it
> >>>through steps 1-3, but I'm stuck on step 4 and I can't find an example
> >>
> >>or
> >>
> >>>tutorial telling me how to do it.
> >>>
> >>>The relevant code snippets are:
> >>>
> >>>The ZPT's body...
> >>>
> ...
> >>>
> >>>...The one-line Python script "delete_person_py" that the form's action
> >>>attribute calls...
> >>>
> >>>container.delete_person(person_id=context.REQUEST.get('person_id'))
> >>>
> >>>...The Z SQL method delete_person(person_id) that the Python script
> >>
> >>calls...
> >>
> >>>delete from person where 
> >>>
> >>>...And a URL to the test page in its current incarnation...
> >>>
> >>>http://dhat.vega.zettai.net/clients/ridhwan/dhr3/deltest.htm
> >>>
> >>>What's wrong with this page is that you have to hit the "Refresh This
> >>
> >>Page"
> >>
> >>>link to get it to do what I want it to do automatically.
> >>>
> >>>I suspect that what I'm missing is some basic HTML knowledge.  But
> >>
> >>whatever
> >>
> >>>it is, I'd appreciate your help in suggesting the missing piece.
> >>
> >>You submit to a script, going that url, and the script is responsible
> >>for providing the output of the page.
> >>
> >>Since you write no output, you see no action in your browser. Some
> >>browsers may display a blank page, which probably would have been more
> >>helpful to you.
> >>
> >>You want your script to do something. It might print out some text to
> >>form HTML, but that's nasty. It usually will either (a) call some other
> >>object, like a page template, to provide output, or (b) do a redirect.
> >>
> >>Case A:
> >>   return context.some_page()
> >>
> >>Case B:
> >>   context.REQUEST.RESPONSE.redirect('some_page')
> >>
> >
> > GREAT!!  Case B works perfectly (and it would have taken me forever to
> guess
> > this solution).  Case A didn't work when written as
> >
> > return context.deltest.htm()
> >
> > but, who cares?
> 
> Look at your Python. It understands a dot as an attribute access. That's
> why Zope historically avoids dotted object names. Witness 'index_html'.
> 
> You may use dictionary lookup:
> 
>   context['deltest.htm']()
> 
> or getattr.
> 
> >>In your case, since this is a destructive method, you probably want do a
> >>redirect, back to your listing.
> >
> > "Destructive" means that the script has a

Re: [Zope] Zope3 DTML in Filesystem ZSQL

2005-05-18 Thread Stephan Richter
On Wednesday 18 May 2005 16:50, David Pratt wrote:
> Wow.  This could really simplify things however I am still operating
> within the CMF framework so until there is more this way,  I don't know
> what I can use now in this context?  What would really be great is the
> form generation etc from the zope schema since I am not using
> Archetypes or Plone.  I could really use that now. I haven't used Five
> before.  Would this allow me to use the zope schema to autogenerate my
> forms with the validation but run it through Zope2?

Yep, Five will give you those features.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
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] "Save Changes" executes Python script

2005-05-18 Thread Dieter Maurer
Bert Vanderbauwhede wrote at 2005-5-18 09:22 +0200:
>We have written a Python script that sends a mail. Everytime we modify
>this script with
>Firefox 1.0.4 in Windows and click "Save Changes", the script is saved
>and executed.
>So everytime we receive a mail.
>
>This does not happen when we modify the script with Internet Explorer
>or Firefox 1.0.4
>in Linux.
>
>Does anyone know about this problem?

Check the ZServer log file (usually called "Z2.log").
Do you see an additional request in this logfile (which executes the script)?

-- 
Dieter
___
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] Zope3 DTML in Filesystem ZSQL

2005-05-18 Thread David Pratt
Wow.  This could really simplify things however I am still operating 
within the CMF framework so until there is more this way,  I don't know 
what I can use now in this context?  What would really be great is the 
form generation etc from the zope schema since I am not using 
Archetypes or Plone.  I could really use that now. I haven't used Five 
before.  Would this allow me to use the zope schema to autogenerate my 
forms with the validation but run it through Zope2?

Regards
David
On Wednesday, May 18, 2005, at 11:56 AM, Stephan Richter wrote:
On Wednesday 18 May 2005 10:45, David Pratt wrote:
Can someone advise whether Zope3 with continue to use DTML for
filesystem zsql  or is there something else?  I am starting something
and concerned about compatibility say a year or more from now when
Zope3 will become the standard.
Zope 3's SQL script supports DTML and will keep supporting it. 
However, note
that Zope 3 does not encourage this line of development. Many people 
dealing
with SQL decide to use sqlos; see http://codespeak.net/z3/.

Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
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: the joy of hacking ZPublisher

2005-05-18 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jim Abramson wrote:

> In my Zope 2.7 Product, I'm trying to implement a special folder, which
> intercepts the publishing call to any subobject and wraps the entire
> call in another.
> 
> A concrete example: where the default action would be to traverse
> /MyProduct/SpecialFolder/something, and publish the attr 'something'
> from SpecialFolder, I want this to happen instead:
> 
> doSomethingBeforeCallingTheRequestedObj()
> try:
> return mapply( something, blahblah...)
> finally:
> doSomethingAfterCallingTheRequestedObj()
> 
> Why? I need to do stuff to the REQUEST before the object is called (this
> part wasn't difficult), and then do something *after* it's called - no
> matter what the results were.  But only for publishables that live in or
> beneath the Special Folder.

Sounds like you want what AccessRules provide, which is a way to provide
a configurable hook into the publishing traversal process.  The
following thread explains the rationale for that hook, from before it
was included in Zope proper:

  http://mail.zope.org/pipermail/zope-dev/1999-December/002667.html

> In fact I have something working, but one big problem - it breaks
> management screens in a bad way.  The implementation is pasted below.
> Is there some much simpler way to accomplish this behavior?  And am I
> short-circuiting security machinery in some dangerous way?


Tres.
- --
===
Tres Seaver   [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCi5L0+gerLs4ltQ4RAvexAJ9jh3QN7Nk5HN+zjdjQzUeshX4NAwCfQgEF
fhJpTReSx95BQ4aR3KG69IM=
=LsRY
-END PGP SIGNATURE-

___
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] display object without index_html

2005-05-18 Thread Christopher Rivard
i am developing a Zope product (2.7) with a "homepage" content type and
want this object to display as the index of a folder.
for other custom objects, i have display methods that call an index view
( using DTMLFile) of the object like this:
#homepage view
index_html = DTMLFile('dtml/indexHomepage', globals())
i want this object to display as the index of the folder without:
folder/index_html/index_html
however, when i render the object, i get:

remove display:
http://localhost:8080/www/index_html/index_html has an empty or missing 
docstring. Objects must have a docstring to be published.

how can i ensure that an "homepage" object with an id of index_html will 
display as the index of a folder (without calling 
folder/index_html/index_html)?
i hope i explained this coherently...

any insight would be greatly appreciated-
Thanks,
Chris





___
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] zopewiki news for april

2005-05-18 Thread Simon Michael
*About the Zopewiki project*
zopewiki.org aims to be a simple, comprehensive, user-maintained 
repository for Zope documentation, notes and links - a hitch-hiker's 
guide to Zope. See http://zopewiki.org for more.

*News*
In april, the wiki seemed to come alive due to the number of different 
people editing (10, as a rough guess). There has been a fair amount of 
cleanup activity in recent weeks.

Some anti-spam measures were installed and there have been no spam 
incidents recently. This impacts users, however: you will not be allowed 
to add external links until you have configured a username at 
http://zopewiki.org/ZopeWiki/useroptions . At the moment this is not 
spelled out explicitly.

The mirrored ZopeBook content has been removed in favour of links to the 
master copy at plope.com. There is a page linking to each chapter, which 
might serve for annotation/discussion of the chapters as long as 
backtalk comments are disabled.

For more, see
http://zopewiki.org/ZopeWikiNews
http://zopewiki.org/ZopeWikiDiscussion
http://zopewiki.org/WikiStats
___
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] Zwiki 0.41 released, news for april

2005-05-18 Thread Simon Michael
Seems I'm never going to finish this.. just *post* it!
*What is it ?*
Zwiki is a Zope product for building wikis - a special kind of website
that's easy for anyone to edit. Zwiki was started in 1999 by Simon
Michael and now receives improvements from many contributors. It is
released under the GNU GPL. A new version is released on the first of
the month. See http://zwiki.org for more.
*0.41 release summary*
Some anti-spam features, skin fixes and translation updates. Full
release notes are below.
*Zwiki news this month*
Development activity, contributors
Translation updates from T.C. Chou (chinese) and Gaspar Quiles 
(spanish), and a number of fixes from Jens Nachtigall. Thank you!

Bug reporting & closing activity
bug day on the first friday of the month
Documentation activity
reorganized front page
UsersGuide and AdministratorsGuide are fairly complete and accurate
old docs have been demoted to *Notes and linked less prominently
Discussion
New zwiki-edits list and mail setup
new anti-spam features installed (no external links by unidentified 
users, delayed indexing); no spam since

As a reminder, experimental rss links are available, linked on the
FrontPage. They are
.../pages_rss - new pages in this wiki
.../changes_rss - recent edits in this wiki
*Links*
http://zwiki.org - Zwiki home, with all download, documentation &
discussion links
http://zwiki.org/ZwikiFunding - how to donate or sponsor a feature

*Release notes*
Summary
Some anti-spam features, skin fixes and translation updates.
Upgrade notes
Translations may be somewhat in flux this release.
Configuring
* restrict external links: if a max_anonymous_links int property is
defined, edits from unidentified users (with no username) containing
more than that number of http:// links will be refused and logged
* delayed indexing: pages now include the NOINDEX meta tag for 24 hours
after an edit, to reduce the chance of spam links being indexed by
search engines.
Browsing
* show page source links when using thorough search, to help with spam
cleanup
Mail
* make subscribe form help reflect the comments/edits mailout policy
(Jens Nachtigall)
* AnonymousUserSubscriptionInPlone (Jens Nachtigall) fixes #878
anonymous subscription in cmf/plone subscribes "Anonymous User"
* br_for_subscribed_pages_list_on_subscribeform (Jens Nachtigall) If one
is subscribed to several pages, theses pages are on the same line, which
looks confusing. Now it is done as with the page_subscribers list on the
very same subscribeform, ie an "
" is inserted between each page name.
General - i18n
* regenerate pot and po files, and this time with up-to-date Default
comments (#1093, SM, Jens Nachtigall)
* mark_PREVIEW_as_translatable (Jens Nachtigall)
* chinese translation updates (T.C. Chou)
* spanish translation updates (Gaspar Quiles)
General - skins
* subscribeform_remove-unneccessary-span-tags (Jens Nachtigall)
* new api method: lastEditIntervalInHours
___
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] the joy of hacking ZPublisher

2005-05-18 Thread Jim Abramson
Title: the joy of hacking ZPublisher






In my Zope 2.7 Product, I'm trying to implement a special folder, which intercepts the publishing call to any subobject and wraps the entire call in another.

A concrete example: where the default action would be to traverse /MyProduct/SpecialFolder/something, and publish the attr 'something' from SpecialFolder, I want this to happen instead:

doSomethingBeforeCallingTheRequestedObj()

try:

    return mapply( something, blahblah...)

finally:

    doSomethingAfterCallingTheRequestedObj()


Why? I need to do stuff to the REQUEST before the object is called (this part wasn't difficult), and then do something *after* it's called - no matter what the results were.  But only for publishables that live in or beneath the Special Folder.

In fact I have something working, but one big problem - it breaks management screens in a bad way.  The implementation is pasted below.  Is there some much simpler way to accomplish this behavior?  And am I short-circuiting security machinery in some dangerous way?


class Wrapper(Implicit):

    """voodoo"""

    

    id = meta_type = title = "Wrapper"

    

    def __init__(self, publishable):

    self.pub = publishable


    def index_html(self):

    """

    render the results to the client

    """

    REQUEST = self.REQUEST

    print self.__class__.__name__, 'calling', self.pub

    try:

    return mapply(self.pub, REQUEST.args, REQUEST,

    call_object,1,

    missing_name,

    dont_publish_class,

    REQUEST, bind=1)

    finally:

    print self.__class__.__name__, 'done'

    print ''

    print ''

    

    __call__ = index_html

    

Globals.InitializeClass(Wrapper)    



class SpecialFolder(Folder):


    def __bobo_traverse__ (self,REQUEST,key):

    print '__bobo_traverse__', REQUEST.URL, key

    stack = REQUEST['TraversalRequestNameStack']

    target = getattr(self,key)

    if stack: return target

    return Wrapper(target).__of__(self)

    



___
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] Zope3 DTML in Filesystem ZSQL

2005-05-18 Thread Stephan Richter
On Wednesday 18 May 2005 10:45, David Pratt wrote:
> Can someone advise whether Zope3 with continue to use DTML for
> filesystem zsql  or is there something else?  I am starting something
> and concerned about compatibility say a year or more from now when
> Zope3 will become the standard.

Zope 3's SQL script supports DTML and will keep supporting it. However, note 
that Zope 3 does not encourage this line of development. Many people dealing 
with SQL decide to use sqlos; see http://codespeak.net/z3/.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
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] Zope3 DTML in Filesystem ZSQL

2005-05-18 Thread David Pratt
Can someone advise whether Zope3 with continue to use DTML for 
filesystem zsql  or is there something else?  I am starting something 
and concerned about compatibility say a year or more from now when 
Zope3 will become the standard.

Regards,
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] Seeking advice on Zope implementation

2005-05-18 Thread Stephan Richter
On Wednesday 18 May 2005 10:13, Dan Pozmanter wrote:
> So there is only one service then?

Well, in Zope 3.0 there are many services. But by definition services cannot 
be simply removed, since they are essential to the system. However, other 
componets can be removed more easily.

In Zope 3.1 we removed the concept of services. All existing services were 
implemented using utilities.

> >From the book, it seemed like there was a service for services, utilities,
> > etc.
>
> Will much of the functionality from cmf being added to the core be
> implemented via utilities?

Utilities map to the CMF concept of Tools. Certain ideas from CMF were 
migrated into Zope 3, but I doubt that all of them will be ported into the 
core, since Zope 3 is an application server, not a CM framework. However, 
z3lab.org was just created to discuss a framework on top of Zope 3 that will 
provide CM-related features.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
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] Seeking advice on Zope implementation

2005-05-18 Thread Dan Pozmanter
So there is only one service then?
>From the book, it seemed like there was a service for services, utilities, etc.

Will much of the functionality from cmf being added to the core be implemented 
via utilities?

-Original Message-
From: Stephan Richter [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 17, 2005 7:11 PM
To: Dan Pozmanter
Cc: zope@zope.org; pythonic
Subject: Re: [Zope] Seeking advice on Zope implementation

On Tuesday 17 May 2005 18:25, Dan Pozmanter wrote:
> "In Zope 3 you can turn off as many unwanted features as you like"
>
> That sounds really cool.  How so?
> (Is there a tentative list of all zope 3 services?  Do you need to run 
> all of them?)

No, there is just one network service. But there are many utilities (in the 
context of a component architecture) that you can simply turn off by not 
loading the configuration files. Zope 3 registers new functionality using a 
configuration language called ZCML. You can decide which configuration files 
you want to load and which ones you do not. 

Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web 
Software Design, Development and Training
___
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] Running out of sockets

2005-05-18 Thread Gaute Amundsen
On Thursday 12 May 2005 20:45, Dieter Maurer wrote:
> Gaute Amundsen wrote at 2005-5-12 00:17 +0200:
> > ...
> >Restarting zope has fixed it for now, but
> > ...
> >"lsof -a -U -uzope" and "lsof -uzope | wc -l"
> >Shows the number of open sockets steadily growing,
> >and apparently none closing..
>
> You might be able to determine the second partner for the socket
> (with "netstat", I think). This may give you a hint
> for what purpose the sockets are used.

It turned out the problem was MySQL-python-1.0.0-1 vs. Mysql 4.1
Upgrading MySQL-python to 1.2 solved the problem.

Thanks

Gaute Amundsen
___
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] Adding zclass inside folder with python

2005-05-18 Thread Cliff Ford
A couple of lines at the bottom show one way to create a folder and an 
object inside that folder...

Anthu Nguyen wrote:
Hi,
I've tried everything I can think of and am probably missing something
obvious - help...
I'm trying to (1) Create a folder, then (2) Add a new zclass inside that
folder.
Instead, the zclass is being added in the same space as the folder:
- What I want:
New Folder
New ZClass
- What's happening:
New Folder
New ZClass
===
The code that doesn't work:
request = context.REQUEST
pbuildid = request.pbuildid
# Add a new folder with id=pbuildid
context.manage_addFolder(id=pbuildid)
# Add a new instance of the ZClass inside new folder
instance = context.pbuild.createInObjectManager(request['id'], request)
instance.propertysheets.pbuild_properties.manage_editProperties(request)
context.manage_addProduct['OFSP'].manage_addFolder(REQUEST.Filename, 
REQUEST.Title)

# create an index_html DTML document
context[REQUEST.Filename].manage_addProduct['OFSP'].manage_addDTMLMethod('index_html',
title="", file="Initial content")
HTH
Cliff
___
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] code completion for ZPT

2005-05-18 Thread Milos Prudek
Hi,
is there an editor that would support code completion for Page Templates 
and maybe even code completion for Zope3 new technologies?

Currently I use ViM on Linux - but a lot of typing is required, like 
"tal:attributes" - 14 keystrokes.

--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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] VirtualHost

2005-05-18 Thread Brian Hickey



Sorry guys, scrap that last one - transient network 
problem.  All working again now.
 
Thanks,
Brian
 

  - Original Message - 
  From: 
  Brian 
  Hickey 
  To: zope@zope.org 
  Sent: Wednesday, May 18, 2005 9:49 
  AM
  Subject: [Zope] VirtualHost
  
  Hi all,
   
  Having a bit of trouble with virtual hosting, but 
  I'm guessing the answer is probably simple.
   
  My Zope instance is running on a 
  different machine to my apache server.  I have created a Plone 
  instance, and everything was working fine, accessible from port 8080 as 
  standard.  I wanted Apache to rewrite so that my Plone instance is 
  available from www.mydomain.com/public/.  So 
  I added the following to my httpd.conf and restarted apache (after following 
  the guide at http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/VirtualHosting.stx):
   
      RewriteRule ^/public(.*) http://111.111.111.11:8080/VirtualHostBase/http/www.mydomain.com.ie:80/Plone/VirtualHostRoot/_vh_public/$1 
  [L,P]
   
  Plone now works fine when accessed from www.mydomain.com/public/
   
  However, I can no longer access my Zope instance 
  from the browser.  If I go to http://111.111.111.11:8080/ (which 
  was working before), I get a "Cannot find server - Page cannot be displayed" 
  error.  In Firefox, I get "The connection was refused when attempting to 
  contact 111.111.111.11".  Obviously Zope is running, as Plone can be 
  viewed through the rewrite.  Also, if I ssh into the server on which Zope 
  is running, I can use it through lynx on the localhost (i.e. lynx http://localhost:8080/manage).  
  Restarting Zope has had no effect.
   
  Any ideas?
   
  Thanks in advance,
  Brian
   
  
  

  ___Zope maillist  
  -  
  Zope@zope.orghttp://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 )


Re: [Zope] More tolerant Stripogram (solution)

2005-05-18 Thread Chris Withers
Jaroslav Lukesh wrote:
Why are you bothering to strip when you basically let people put in all
the abusive tags anyway?
Because it is not abusive tags for intranet blog.
Then why are you using stripogram in the first place?
Chris
--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk
___
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] VirtualHost

2005-05-18 Thread Brian Hickey



Hi all,
 
Having a bit of trouble with virtual hosting, but 
I'm guessing the answer is probably simple.
 
My Zope instance is running on a 
different machine to my apache server.  I have created a Plone 
instance, and everything was working fine, accessible from port 8080 as 
standard.  I wanted Apache to rewrite so that my Plone instance is 
available from www.mydomain.com/public/.  So I 
added the following to my httpd.conf and restarted apache (after following the 
guide at http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/VirtualHosting.stx):
 
    RewriteRule ^/public(.*) http://111.111.111.11:8080/VirtualHostBase/http/www.mydomain.com.ie:80/Plone/VirtualHostRoot/_vh_public/$1 
[L,P]
 
Plone now works fine when accessed from www.mydomain.com/public/
 
However, I can no longer access my Zope instance 
from the browser.  If I go to http://111.111.111.11:8080/ (which 
was working before), I get a "Cannot find server - Page cannot be displayed" 
error.  In Firefox, I get "The connection was refused when attempting to 
contact 111.111.111.11".  Obviously Zope is running, as Plone can be viewed 
through the rewrite.  Also, if I ssh into the server on which Zope is 
running, I can use it through lynx on the localhost (i.e. lynx http://localhost:8080/manage).  
Restarting Zope has had no effect.
 
Any ideas?
 
Thanks in advance,
Brian
 
___
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] "Save Changes" executes Python script

2005-05-18 Thread Bert Vanderbauwhede
Hi,

We have written a Python script that sends a mail. Everytime we modify
this script with
Firefox 1.0.4 in Windows and click "Save Changes", the script is saved
and executed.
So everytime we receive a mail.

This does not happen when we modify the script with Internet Explorer
or Firefox 1.0.4
in Linux.

Does anyone know about this problem?


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