It worked!

based on your suggestion, I tried on google and I found the site:
http://www.rexx.com/~dkuhlman/ <http://www.rexx.com/%7Edkuhlman/>

Thanks for your help!

See the results below!

------------------------------------------------------------------------------------------------------------------------------------------------
CLASS
------------------------------------------------------------------------------------------------------------------------------------------------
def login(self, sUsrNme, sUstPwd):

        result = "OK"

        return result

------------------------------------------------------------------------------------------------------------------------------------------------
routing.py
------------------------------------------------------------------------------------------------------------------------------------------------
map.connect('route01', '/teste/login/:sUsrNme/:sUstPwd',
        controller='teste', action='login',
        sUsrNme='[void]', sUstPwd='[void]' )

------------------------------------------------------------------------------------------------------------------------------------------------
javascript call
------------------------------------------------------------------------------------------------------------------------------------------------
var xhrArgs = {
                url: "/Security/login/:Usr/:Pwd",....



On Mon, Apr 6, 2009 at 6:06 PM, Jens Hoffrichter <[email protected]
> wrote:

>
> Hi Mauricio,
>
> 2009/4/6 Mauricio Daniel Hoffart <[email protected]>:
>
> > I am new to pyton
> > I am trying to use Pylons + Dojo and I am having trouble calling a
> control
> > with multiple parameters. What is an example of that?
> >
> > Thanks a lot
> >
> > Ex:
> >
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> > --IN THE CONTROLLER
> >
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> > class TesteController(BaseController):
> >
> >     @jsonify
> >     def login(self, sUsrNme, sUstPwd ):
> >
> >         result = "ok"
> >
> >         return result
> >
> >
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> > --IN THE PAGE
> >
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> > var xhrArgs = {
> >                 url: "/teste/login/",
> >                 postData: "{Master,Senha}",
> >                 handleAs: "json",
> >                 load: function(sUsrNme, sUsrPwd ){
> >                   dojo.byId("basicFormTab").innerHTML = "Message
> posted.";
> >                 },
> >                 error: function(error){
> >                   dojo.byId("basicFormTab").innerHTML = "We'll 404 in the
> > demo, but that's okay.  We don't have a 'postIt' service on the docs
> > server." ;
> >                 }
> >               }
> >
> > The error returned is:
> > TypeError: login() takes exactly 3 arguments (1 given)
> If you set parameters to the function, they are expected to be given
> in the url (through a routes parameter, so you would have to configure
> a route for that one) - and example for that would be
> /teste/login/Master, then the first argument to the action would be
> "Master"
>
> If you post to the action, like you do, you have to take a look at the
> "request" dictionary, which wil contain the parameters you posted to
> the function, or were in get parameters.
>
> I hope that helps!
>
> Cheers,
> Jens
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to