is this a pydal issue?

59 views
Skip to first unread message

Auden RovelleQuartz

unread,
Jun 8, 2015, 7:03:45 AM6/8/15
to web...@googlegroups.com
What does this error mean? (code seemed to work, before pydal...)

{

Ticket ID

24.211.17.122.2015-06-08.05-34-25.9f6361e2-d387-4cf8-adef-2216ad5c6476

<type 'exceptions.AttributeError'> 'NoneType' object has no attribute 'records'

Version

web2py™Version 2.11.2-stable+timestamp.2015.05.30.16.33.24
PythonPython 2.7.3: /usr/bin/python (prefix: /usr)

Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
Traceback (most recent call last):
File "/home/www-data/web2py/gluon/restricted.py", line 227, in restricted
exec ccode in environment
File "/home/www-data/web2py/applications/omniavx_cxn/controllers/public.py", line 3343, in <module>
File "/home/www-data/web2py/gluon/globals.py", line 412, in <lambda>
self._caller = lambda f: f()
File "/home/www-data/web2py/applications/omniavx_cxn/controllers/public.py", line 920, in signup_captcha
(op_rec == None) or (op_rec2 == None) or (op_rec3 == None) or (op_rec4 == None)):
File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 2506, in __eq__
return (self.records == other.records)
AttributeError: 'NoneType' object has no attribute 'records'
}

Paolo Valleri

unread,
Jun 8, 2015, 7:48:57 AM6/8/15
to web...@googlegroups.com
Your are comparing Rows with None.
The question is why?

Normally, you should compare Rows with Rows. 
In pydal we can add a check to raise an error if the second argument isn't an instance of Rows.

Paolo

On Monday, June 8, 2015 at 1:03:45 PM UTC+2, Auden RovelleQuartz wrote:
What does this error mean?

Marin Pranjić

unread,
Jun 8, 2015, 7:52:35 AM6/8/15
to web2py-users
You should be able to just write:
if not (op_rec and op_rec2 and op_rec3 and op_rec4)

Marin

On Mon, Jun 8, 2015 at 1:03 PM, Auden RovelleQuartz <oves...@gmail.com> wrote:
What does this error mean - I never got it pre-pydal...

--
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.

Auden RovelleQuartz

unread,
Jun 8, 2015, 7:58:22 AM6/8/15
to web...@googlegroups.com
parameter "op_rec" is set to a session parameter that under normal operating conditions is a "Rows" object

if a person goes to the page directly (not the "normal" method) then the "op_rec" parameter would be None and in that case, the code simply redirects the person to a function that sets it to the "Rows" object

thanks for your response!

Paolo Valleri

unread,
Jun 8, 2015, 8:06:02 AM6/8/15
to web...@googlegroups.com
ok, I get it. 
I'll post an update later today to fix the backward compatibility

 Paolo

--
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/elGPpxQsJo4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.

Auden RovelleQuartz

unread,
Jun 8, 2015, 8:10:47 AM6/8/15
to web...@googlegroups.com
this works! thanks...

Auden RovelleQuartz

unread,
Jun 8, 2015, 8:13:08 AM6/8/15
to web...@googlegroups.com
ok thanks

i found workaround (via Marin), but handling None condition would preserve backwards compatibility and make more robust

thanks again for everything!
Reply all
Reply to author
Forward
0 new messages