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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:27:18+00:00 2026-05-29T13:27:18+00:00

I think this should be a simple question to answer. I have the next

  • 0

I think this should be a simple question to answer.

I have the next classes:

class GruposHandler(webapp.RequestHandler):
    def get(self):
        self.obtenerPagina()

    def obtenerPagina(self, pOpcion = None, pMensajeInformacion = None):
        opcion = pOpcion if pOpcion is not None else self.request.get('opcion') 
        usuario = obtenerUsuario()
        rsGrupos = obtenerGruposAll() 
        listaOtrosGrupos = []
        listaGruposSuscriptos = []
        blah blah ........

class NuevoGrupoHandler(webapp.RequestHandler): 
    def post(self):
        nombre = self.request.get('nombre')
        descripcion = self.request.get('descripcion')
        obj = Grupo.get_by_key_name(nombre)
        if obj:
            doRender(self, 'nuevo_grupo.html', {'mensaje_descripcion':'Ya existe un grupo con ese nombre.'})
        else:
            grupo = model.Grupo(key_name = nombre, nombre=nombre, descripcion = descripcion);
            grupo.put()
            grupoHandler = GruposHandler
            grupoHandler.obtenerPagina("gruposMios", 'Informacion: un nuevo grupo fue agregado.')

but it seems that method obtenerPagina from GruposHandler is not being called properly. This is the stacktrace I get:

TypeError: unbound method obtenerPagina() must be called with GruposHandler instance as first argument (got str instance instead)

What I’m 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-05-29T13:27:18+00:00Added an answer on May 29, 2026 at 1:27 pm
    grupoHandler = GruposHandler
    

    ==>

    grupoHandler = GruposHandler()
    

    UPDATE:

    GruposHandler.obtenerPagina() method accepts 3 arguments:
    self, pOpcion=None and pMensajeInformacion=None.

    Since 2 of them are optional, you don’t get:

    TypeError: ... takes exactly 3 arguments (2 given)
    

    when calling it like this:

    GruposHandler.obtenerPagina("gruposMios", 'Informacion: ...')
    

    Instead GruposHandler.obtenerPagina() interprets arguments like this:

    self="gruposMios", pOpcion='Informacion: ...', pMensajeInformacion=None
    

    and raises:

    TypeError: ... must be called with instance (got str instance instead)
    

    To get rid of the exception, you need to call this method from instance:

    GruposHandler().obtenerPagina("gruposMios", 'Informacion: ...')
    

    and self will be passed to obtenerPagina implicitly.

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

Sidebar

Related Questions

Dear all,Now i have this question in my java program,I think it should be
This question should be simple to answer for anyone with Node experience -- unfortunately
I think this should be simple but I am having some difficulty implementing it.
This should be pretty straightforward I would think. I have this string: [quote=Joe Johnson|1]Hi![/quote]
I feel like the answer to this question is really simple, but I really
All, This question probably has a very simple answer - something I'm overlooking. But
I think this may be a very simple question, but I am only just
I have a rather simple question for you.. I feel like I should have
I think this should be simple. Say I've got the following jQuery: $someForm.live('submit', function(event)
I think, the answer to my question is rather simple, but I just can't

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.