[solved] Weird <type 'exceptions.AttributeError'> 'Row' object has no attribute 'id' and Ñ error

1,315 views
Skip to first unread message

Carlos Kitu

unread,
Jan 10, 2015, 8:20:39 AM1/10/15
to web...@googlegroups.com
Hi, just for other developers sake to save some time.

I was getting this error:

<type 'exceptions.AttributeError'> 'Row' object has no attribute 'id'

Versión
web2py™ Version 2.9.11-stable+timestamp.2014.09.15.23.35.11


Traceback (most recent call last):
  File "./web2py/gluon/restricted.py", line 224, in restricted
    exec ccode in environment
  File "./web2py/applications/AlcalaFyE/controllers/appadmin.py", line 671, in <module>
  File "./web2py/gluon/globals.py", line 392, in <lambda>
    self._caller = lambda f: f()
  File "./web2py/applications/AlcalaFyE/controllers/appadmin.py", line 341, in update
    f='download', args=request.args[:1]))
  File "./web2py/gluon/sqlhtml.py", line 1168, in __init__
    self.record_id = str(record[field.name])
  File "./web2py/gluon/dal.py", line 7529, in __getitem__
    raise ae
AttributeError: 'Row' object has no attribute 'id'

It was quite confusing because I could create records (with appadmin or smartgrid), and see them in a grid, and the problem only appeared when I tried to view the record in a form.

I do NEVER use international characters in field names, but as I am spanish,  unintentionally wrote a Ñ character (U+00D1: N with a diacritical tilde) in a field name. As soon as I replaced the Ñ with a N, everything worked fine.
 
I'm quite a new user of web2py, and as I'm dealing with the ins and outs of web2py, I repeatedly skipped such an obvious question and was looking for a more subtle error.
As I couldn't find any reference to this problem in the forum, I thought I would make sense to report it.

I think web2py is a great product. Good job!

Best regards.
Message has been deleted

Massimo Di Pierro

unread,
Jan 12, 2015, 10:26:41 PM1/12/15
to web...@googlegroups.com
Thank you. We all appreciate it. we put lots of work in it.

On Monday, 12 January 2015 13:00:13 UTC-6, Dave S wrote:


On Saturday, January 10, 2015 at 5:20:39 AM UTC-8, Carlos Kitu wrote:
Hi, just for other developers sake to save some time.
[...]
I'm quite a new user of web2py, and as I'm dealing with the ins and outs of web2py, I repeatedly skipped such an obvious question and was looking for a more subtle error.As I couldn't find any reference to this problem in the forum, I thought I would make sense to report it.


This type of feedback is very valuable, I think.  Thank you!
 
I think web2py is a great product. Good job!

I'm impressed, too, and I think the team is very competent, as well as very responsive.

/dps
 

Tom Stratton

unread,
Mar 3, 2015, 12:06:21 PM3/3/15
to web...@googlegroups.com
Follow up to this (and a big Thank You for saving me a lot of digging!)

I had field names with "$" in them which caused the same error. I believe that the rules for field names may be the same as the rules for variable names. I'm guessing that trying to reference a.b.c instead of a.b[c] is causing the issue.

For safety sake - don't use anything in a field name that can't be part of an object/variable name!

Thanks again.

Tom


On Saturday, January 10, 2015 at 5:20:39 AM UTC-8, Carlos Kitu wrote:

Michele Comitini

unread,
Mar 3, 2015, 12:13:45 PM3/3/15
to web...@googlegroups.com
You can use rname or entity quoting to support all of the names your chosen db engines support.  Those are documented in the book.

--
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 web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Stratton

unread,
Mar 4, 2015, 2:59:27 PM3/4/15
to web...@googlegroups.com
Oddly, neither of those terms come up when you search the book online ;-)

I'm glad to have this forum to find the hidden gotchas!

Tom 

Anthony Smith

unread,
Aug 4, 2015, 4:04:58 AM8/4/15
to web2py-users
yes a good find I had the same thing my $ in the field names 

cheers

Dave S

unread,
Jan 12, 2015, 2:00:13 PM1/12/15
to web...@googlegroups.com


On Saturday, January 10, 2015 at 5:20:39 AM UTC-8, Carlos Kitu wrote:
Hi, just for other developers sake to save some time.
[...]
I'm quite a new user of web2py, and as I'm dealing with the ins and outs of web2py, I repeatedly skipped such an obvious question and was looking for a more subtle error.As I couldn't find any reference to this problem in the forum, I thought I would make sense to report it.


This type of feedback is very valuable, I think.  Thank you!
 
I think web2py is a great product. Good job!

Abhijeet Deshani

unread,
Jun 18, 2016, 8:47:43 AM6/18/16
to web2py-users
'Row' object has no attribute 'id' can solve by using for loop for your entries,mine was solved by that.
Reply all
Reply to author
Forward
0 new messages