Unfortunately, that's the exact code that I have.
module "a" sits in my modules folder
Here's the snapshot of local variables before the error:
global a<module 'applications.charter.modules.a' from
'applications\charter\modules\a.py'>datatable'').B<unbound method A.B>a.A<class
applications.charter.modules.a.A>
*code:*
import othermodule
import a
def index():
form = SQLFORM(db.parameters)
datatable = ""
if form.process().accepted:
datatable = a.A().B("hello world")
elif form.errors:
response.flash = 'form has errors'
*error below*
File "C:/Users/hojunhwang5/My
Documents/web2py/applications/charter/controllers/default.py"
<http://127.0.0.1:8000/admin/default/edit/charter/controllers/default.py>, line
28, in index
datatable = a.A().B("hello world")
TypeError: B() takes exactly 1 argument (2 given)
Error snapshot [image:
help]<http://127.0.0.1:8000/admin/default/ticket/charter/127.0.0.1.2013-05-24.10-27-40.d763190c-14be-43d8-aca5-073877b6c83b#>
<type 'exceptions.TypeError'>(B() takes exactly 1 argument (2 given))
On Friday, May 24, 2013 2:45:49 AM UTC-4, gthwang5 wrote:
>
> I have the following class called "a"
>
> *a.py *
>
> class A:
>
> def B ( self, var ):
> return var
>
> in my *default.py*
>
> import a
>
> def index():
>
> form = SQLFORM(db.parameters)
> datatable = ""
>
> if form.process().accepted:
> datatable = a.A().B("hello world")
>
> return dict(datatable)
>
> *I get the following error: *
> <type 'exceptions.TypeError'> B() takes exactly 1 argument (2 given)
>
> What could be going on here? After two hours I still don't get why B()
> isn't called as it's supposed to be......
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.