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 8062471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:40:46+00:00 2026-06-05T10:40:46+00:00

Given this simple class: class RenderResponseHandler(webapp2.RequestHandler): def __init__(self): self.nombreUsuario = obtenerUsuarioTablaUsuario().nombre if obtenerUsuarioTablaUsuario() else

  • 0

Given this simple class:

class RenderResponseHandler(webapp2.RequestHandler):
    def __init__(self):
        self.nombreUsuario = obtenerUsuarioTablaUsuario().nombre if obtenerUsuarioTablaUsuario() else None
    def doRender(self, tname='index.html',values = {}):
        temp = os.path.join(os.path.dirname(__file__),
                            'templates/'+tname)
        if not os.path.isfile(temp):
            return False

        self.nombreUsuario = obtenerUsuarioTablaUsuario().nombre if obtenerUsuarioTablaUsuario() else None

        newval = dict(values)
        newval['path'] = self.request.path

        if nombreUsuario:
            url_linktext = 'logout'
        else:
            url_linktext = 'login'

        newval['url_linktext'] = url_linktext
        newval['nombreUsuario'] = nombreUsuario

        template = jinja_environment.get_template(tname)
        outstr = template.render(newval)
        self.response.out.write(outstr)

        return True

    def obtenerPagina(self, pOpcion = None, pMensajeInformacion = None):
        opcion = pOpcion if pOpcion is not None else self.request.get('opcion')
        if opcion == 'index':
            self.doRender('index.html')
        ####

If I do this, the page shows normally

class MainPage(webapp2.RequestHandler):
    def get(self):
        r = RenderResponseHandler()
        r.request = self.request
        r.response = self.response 
        r.obtenerPagina('index')

Although, When trying to inherit from RenderResponseHandler,like this:

class MainPage(RenderResponseHandler):
    def get(self):
        if self.doRender(self.request.path):
            return
        self.obtenerPagina('index') 

I get the following exception:

Traceback (most recent call last):   File "/home/lucas/Dropbox/Tesis/Revision 2012/Desarrollo/Entorno/AppEngine SDK/google_appengine_1.6.6/lib/webapp2/webapp2.py", line 1536, in
__call__
    rv = self.handle_exception(request, response, e)   File "/home/lucas/Dropbox/Tesis/Revision 2012/Desarrollo/Entorno/AppEngine SDK/google_appengine_1.6.6/lib/webapp2/webapp2.py", line 1530, in
__call__
    rv = self.router.dispatch(request, response)   File "/home/lucas/Dropbox/Tesis/Revision 2012/Desarrollo/Entorno/AppEngine SDK/google_appengine_1.6.6/lib/webapp2/webapp2.py", line 1278, in default_dispatcher
    return route.handler_adapter(request, response)   File "/home/lucas/Dropbox/Tesis/Revision 2012/Desarrollo/Entorno/AppEngine SDK/google_appengine_1.6.6/lib/webapp2/webapp2.py", line 1101, in
__call__
    handler = self.handler(request, response) TypeError: __init__() takes exactly 1 argument (3 given)

What am I doing wrong?

Thanks in advance!

  • 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-06-05T10:40:48+00:00Added an answer on June 5, 2026 at 10:40 am

    You need to implement the __init__ of RenderResponseHandler Like this: def __init__(self, request=None, response=None) and pass request and response to the base class.

    The layers that call the request handler class relay on the contract that the ctor will have those paramters.

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

Sidebar

Related Questions

Given this simple class: class HasBytes { public byte[] Bytes { get; set; }
Given a simple Java class like this: class MyData { public int a; public
Given this very simple Variable - Clause model class Variable(name: String, negated: Boolean =
Given this really simple Wicket component: public class ProductImage extends WebComponent { public ProductImage(String
This is a purely theoretical question. Given three simple classes: class Base { }
Given this sample code: #include <iostream> #include <stdexcept> class my_exception_t : std::exception { public:
This is probably pretty simple. I want to select all elements of a given
This should be a simple one, but I'm a beginner with C#. Given a
Fairly simple; I'm just curious if there's a better way to accomplish this. Given
Given a simple class that overloads the '[ ]' operator: class A { public:

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.