update finds previous error in function definition

25 views
Skip to first unread message

Carl Hunter Roach

unread,
Mar 1, 2019, 7:07:28 AM3/1/19
to web2py-users
I've been remiss and skipped too may Web2py updates.

I've now updated from web2py v2.14.6 to web2py v2.18.2

db.py

openings_service = Service()

controller.py

@openings_service.json
def submit_openings():
    ...


An external program calls my Web2py service and the function submit_openings()
The caller has passed in a parameter and even though my `def` doesn't define a parameter I was able to access the required parameter via `request`

After the update to Web2py 2.18.2 the call no longer succeeds.

TypeError: submit_openings() takes no arguments (1 given)

I can see why this no longer works and the fix is simple; redefine the `def` in my code as:

@openings_service.json
def submit_openings(openings):


But I'd like to know what changed in Web2py? Mainly to confirm that I am using Web2py correctly.

Massimo Di Pierro

unread,
Mar 3, 2019, 3:05:20 AM3/3/19
to web2py-users
Can you please open a ticket about this?

Carl Hunter Roach

unread,
Mar 3, 2019, 5:05:40 AM3/3/19
to web...@googlegroups.com

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/G-_M0yNe5wc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Carl Hunter Roach

Founder of Midnight 30
Jobs at great companies you can commute to.
Reply all
Reply to author
Forward
0 new messages