Hi Kuba,
the equivalent of this in Django
> def add_cdr(request):
> cdr = request.POST['cdr']
> return HttpResponse("OK")
in web2py would be
def add_crd():
return request.vars.cdr
or more specifically to capture POST vars and not GET vars
def add_crd():
return request.post_vars.cdr
Massimo
On May 4, 2:09 pm, Kuba Kucharski <[email protected]> wrote:
> I have a voip app logging cdr(s) to a django app [ freeswitch, wikipbx ]
> This means that a call triggers a http POST method with a given url.
> I am trying to write my own web2py interface to catch those billing logs.
>
> In django views there is:
>
> def add_cdr(request):
> cdr = request.POST['cdr']
> return HttpResponse("OK")
>
> and printing 'cdr' variable results in a long xml billing record...
>
> In web2py, in controller, I did:
>
> def add_cdr():
> cdr = str(request.vars.cdr)
>
> And I get nothing in there.
>
> When I wrote:
>
> print cdr, nothing happens
> also:
> print BEAUTIFY(request.vars)
> I get:
> <div><table></table></div>
>
> What did I miss?
>
> Note that I don't know and don't claim to know django.. It is probably
> trivial, stupid lack of knowledge, but please help.
>
> --
> Kuba
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---