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

  • SEARCH
  • Home
  • 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 6037981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:09:09+00:00 2026-05-23T06:09:09+00:00

I have a Python function registered as a View in Plone. I need to

  • 0

I have a Python function registered as a View in Plone. I need to be able to call another function from within this registered function. I’m not sure if it would be best to register this other function as a view as well and try to call that (don’t know how to call other views), or if there is a better way to handle this.

Basically I’m creating a function in Python that needs to be callable from other Python functions (that are registered as Views).

  • Edit –
    I have tried calling it like any other function:

(pytest.py)
def Test(self):
return "TEST"

And in my Python script registered as a view:

import pytest
def PageFunction(self):
return pytest.Test()

However, this always seems to crash. If I leave the pytest.Test() out and return a simple string, it seems to work fine (so I don’t think the import pytest line is causing any problems…)

  • 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-23T06:09:09+00:00Added an answer on May 23, 2026 at 6:09 am

    Just import it and call it as any other function. You don’t want to make it a view – that requires you to do a MultiAdapter lookup which is a real pain, and completely unnecessary.

    [Edit – strictly using a view is a MultiAdapter lookup, but you can shortcut it via traversal, but that still isn’t worth the effort]

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

Sidebar

Related Questions

I have a python function that makes a subprocess call to a shell script
I have a python function defined as follows which i use to delete from
I have a python function that scrapes some data from a few different websites
I have a Python function in which I am doing some sanitisation of the
I have a Python function that takes a numeric argument that must be an
I have a python function that randomize a dictionary representing a position specific scoring
Say I have a Python function that returns multiple values in a tuple: def
Does python have a function like call_user_func() in PHP? PHP Version: call_user_func(array($object,$methodName),$parameters) How do
I have two Python functions, both of which take variable arguments in their function
In python I have the following function: def is_a_nice_element(element, parameter): #do something return True

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.