Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5983211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:11:53+00:00 2026-05-22T22:11:53+00:00

In my Zope instance, I have a Python script registered as a browser page.

  • 0

In my Zope instance, I have a Python script registered as a browser page. I have the following code as its registry:

<browser:page name="test" for="*" permission="zope2.Public" class="browser.test.PyTest" attribute="CallPy" />

This function, “PyTest.CallPy” is defined as:

def CallPy(self, data): ...

I then use JavaScript to call the function, passing data in:

$.ajax({ url: "@@test", data: ({data: "mydata"}), dataType: "text", success: ..., error: ... });

However, when I make this call, I get an error that says “CallPy() takes exactly 2 arguments (1 given)”.

How do I register this function as a page that passes in this data when it is called?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:11:54+00:00Added an answer on May 22, 2026 at 10:11 pm

    You’re missing rather a lot of detail on your method. Is it a method of a class? Or standalone? Normally, self would refer to an instance of the class PyTest – which would be a subclass of BrowserView.

    Then, the data you pass to the view (@@test) is retrieved from the Request object, which is available in self.request (specifically, in this case, self.request.form.data) (So, you don’t specify a ‘data’ argument to the method).

    hmmm. I don’t think you want the parentheses around the dict in: data: ({data: "mydata"}).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been tinkering around with the Zope test browser in Python, exploring its suitability
I have a zope instance with many plone sites each for different customers. I
The following browser view should return the content of the front page of the
I have multiple plone sites in one zope instance (ZODB). Now I'd like to
I like to use IPython's zope profile to inspect my Plone instance, but a
I need to convert a zope 2 DateTime object into a Python datetime object.
I can import MySQLdb from the interactive python command line but Zope gives me
I have been running zope / plone site for about a year now -
Plone 2.5.1 Zope 2.9.5 CMFEditions 1.0rc1 If you create a page in a folder
We have two zope servers running our company's internal site. One is the live

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.