I have to copy the error ticket and paste it here, please help me. It's
been killing me for days! I can't write a post and post it to the database
of the form crud.create(db.table)
All the tutorials I follow used it perfectly but I have never used it
successfully. What is happening?
"
<type 'exceptions.TypeError'> long() argument must be a string or a number,
not 'Table'Versionweb2py™Version 2.9.5-stable+timestamp.2014.03.16.02.35.39
PythonPython 2.7.5+: /usr/local/bin/uwsgi (prefix: /usr)Traceback
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
Traceback (most recent call last):
File "/home/GideonG/web2py/Gidigba/gluon/restricted.py", line 220, in
restricted
exec ccode in environment
File
"/home/GideonG/web2py/Gidigba/applications/Gidigba/controllers/default.py"
<https://www.gidigba.ng/admin/edit/Gidigba/controllers/default.py>, line 230,
in <module>
File "/home/GideonG/web2py/Gidigba/gluon/globals.py", line 385, in <lambda>
self._caller = lambda f: f()
File
"/home/GideonG/web2py/Gidigba/applications/Gidigba/controllers/default.py"
<https://www.gidigba.ng/admin/edit/Gidigba/controllers/default.py>, line 194,
in timeline
if form.accepts(request):
File "/home/GideonG/web2py/Gidigba/gluon/sqlhtml.py", line 1592, in accepts
self.vars.id = self.table.insert(**fields)
File "/home/GideonG/web2py/Gidigba/gluon/dal.py", line 9114, in insert
ret = self._db._adapter.insert(self, self._listify(fields))
File "/home/GideonG/web2py/Gidigba/gluon/dal.py", line 1353, in insert
query = self._insert(table,fields)
File "/home/GideonG/web2py/Gidigba/gluon/dal.py", line 1344, in _insert
values = ','.join(self.expand(v, f.type) for f, v in fields)
File "/home/GideonG/web2py/Gidigba/gluon/dal.py", line 1344, in <genexpr>
values = ','.join(self.expand(v, f.type) for f, v in fields)
File "/home/GideonG/web2py/Gidigba/gluon/dal.py", line 1552, in expand
return str(self.represent(expression,field_type))
File "/home/GideonG/web2py/Gidigba/gluon/dal.py", line 2014, in represent
return str(long(obj))
TypeError: long() argument must be a string or a number, not 'Table'
Error snapshot [image: help]
<https://www.gidigba.ng/admin/default/ticket/Gidigba/41.203.69.5.2014-08-11.00-24-47.07c4862d-35e4-41e3-842c-4bd7c01f5921#>
<type 'exceptions.TypeError'>(long() argument must be a string or a number,
not 'Table')
inspect attributes
Frames
-
*File /home/GideonG/web2py/Gidigba/gluon/restricted.py in restricted at
line 220* code arguments variables
-
*File
/home/GideonG/web2py/Gidigba/applications/Gidigba/controllers/default.py in
<module> at line 230* code arguments variables
-
*File /home/GideonG/web2py/Gidigba/gluon/globals.py in <lambda> at line
385* code arguments variables
-
*File
/home/GideonG/web2py/Gidigba/applications/Gidigba/controllers/default.py in
timeline at line 194* code arguments variables
-
*File /home/GideonG/web2py/Gidigba/gluon/sqlhtml.py in accepts at line
1592* code arguments variables
-
*File /home/GideonG/web2py/Gidigba/gluon/dal.py in insert at line 9114*
code arguments variables
-
*File /home/GideonG/web2py/Gidigba/gluon/dal.py in insert at line 1353*
code arguments variables
-
*File /home/GideonG/web2py/Gidigba/gluon/dal.py in _insert at line 1344*
code arguments variables
-
*File /home/GideonG/web2py/Gidigba/gluon/dal.py in <genexpr> at line
1344* code arguments variables
-
*File /home/GideonG/web2py/Gidigba/gluon/dal.py in expand at line 1552*
code arguments variables
-
*File /home/GideonG/web2py/Gidigba/gluon/dal.py in represent at line
2014* code arguments variables
Function argument list
(self=<gluon.dal.MySQLAdapter object>, obj=<Table auth_user
(id,first_name,last_name,email,..._government,city_of_resident,image,phone_number)>,
fieldtype='reference auth_user')
Code listing
2009.
2010.
2011.
2012.
2013.
2014.
2015.
2016.
2017.
2018.
return str(obj)
elif field_is_type('reference'): # reference
# check for tablename first
referenced = fieldtype[9:].strip()
if referenced in self.db.tables:
return str(long(obj))
p = referenced.partition('.')
if p[2] != '':
try:
ftype = self.db[p[0]][p[2]].type
"
--
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 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/d/optout.