title: Web.py pass parameter to GET/POST function via ajax call on form submit
body: <p>I have a main page that has a <code>GET</code> and a <code>POST</code> function. The <code>POST</code> function gets data from a search screen and should pass this information, via an ajax call, to the <code>worldMarkers</code> class. This is separate because it will be needed for other aspects of the application.</p>
  
  <p>The goal of this, is to have a user press submit on <code>index</code> and during the <code>POST</code> call, it is able to limit the results retrieved. This logic exists in the <code>worldMarkers</code> class.</p>
  
  <pre><code>class index(object):
      def GET(self):
          # do things to generate the page
          return html
  
      def POST(self):
          continents = web.input(search_continents=[])
          countries = web.input(search_countries=[])
  
          searchDict = {}
          if continents['search_continents']:
              searchDict['continents'] = continents['search_continents']
          if countries['search_countries']:
              searchDict['countries'] = countries['search_countries']
  
          markers = worldMarkers()
  
          # Yes, this just spits out the results, nothing fancy right now
          return markers.GET()
  
          #alternatively,
          #return markers.GET(searchDict)
  
  
  
  class worldMarkers(object):        
      def __init__(self, **kargs):
          self.searchDict = None
          if 'searchDict' in kargs:
              self.searchDict = kargs['searchDict']
  
      def GET(self):
          print "SearchDict: %s" % (self.searchDict)
          # No searchDict data exists
  </code></pre>
  
  <p>The first option, with no parameters to <code>markers.GET()</code> means that none of my search criteria has been passed. If I do <code>markers.GET(searchDict)</code>, I receive this error:</p>
  
  <pre><code>&lt;type 'exceptions.TypeError'&gt; at /
  GET() takes exactly 1 argument (2 given)
  </code></pre>
  
  <p>How can I pass my search parameters to the <code>worldMarkers</code> class? </p>