[web2py] Re: row.update_record() leaves row as None (only sometimes)

2018-07-19 Thread Anthony
On Thursday, July 19, 2018 at 11:25:28 AM UTC-4, Lisandro wrote: > > That was my first thought: in some cases, another request deletes the > record right in the instant between the execution of the first and second > line. > But I thought it wasn't possible because the function runs inside a db

[web2py] Re: row.update_record() leaves row as None (only sometimes)

2018-07-19 Thread Lisandro
Thanks Leonel. I'm using PostgreSQL, so if that case isn't possible, then I think the problem could be in the second line, where the code retrieves the record using row.id: row.update_record(**data) row = db.content[row.id] # the problem could be here row.update_tsv() Remember yesterday I rea

[web2py] Re: row.update_record() leaves row as None (only sometimes)

2018-07-19 Thread Leonel Câmara
It should not be possible if your database has proper transactions like postgresql. If you're using something like mongodb then you're SOL. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2p

[web2py] Re: row.update_record() leaves row as None (only sometimes)

2018-07-19 Thread Lisandro
That was my first thought: in some cases, another request deletes the record right in the instant between the execution of the first and second line. But I thought it wasn't possible because the function runs inside a db transaction. Or could it still happen? Another thought is that the row.id

[web2py] Re: row.update_record() leaves row as None (only sometimes)

2018-07-19 Thread Anthony
On Thursday, July 19, 2018 at 4:26:09 AM UTC-4, Lisandro wrote: > > Well, I owe you an apology, because I got confused regarding which app was > throwing the error and which web2py version was running. > > Until recently, I was using a very old web2py version (2.10). This problem > was happening

[web2py] Re: row.update_record() leaves row as None (only sometimes)

2018-07-17 Thread Dave S
On Tuesday, July 17, 2018 at 4:50:02 PM UTC-7, Leonel Câmara wrote: > > I have to say I'm completely stumped. I don't see how this is even > possible. Are you sure Line 301 is really the line after update_record? > That should be verifiable with the full ticket, not just the stack trace. The ti

[web2py] Re: row.update_record() leaves row as None (only sometimes)

2018-07-17 Thread Leonel Câmara
I have to say I'm completely stumped. I don't see how this is even possible. Are you sure Line 301 is really the line after update_record? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py

[web2py] Re: row.update_record() leaves row as None (only sometimes)

2018-07-17 Thread Leonel Câmara
Hey Peter, I was trying to help Lisandro, I'm not sure what error you're getting. I've seen in other thread that you're getting a ticket error but without looking at the ticket and your code I can't guess what's wrong. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation)

Re: [web2py] Re: row.update_record() leaves row as None (only sometimes)

2018-07-17 Thread Malta Advies
Hello Leonel, I see you gave information to me about my eventually error code and also maybe how to solve this. I have to inform you that I'm not a developer despite. I try to get my site back on track. For this moment I do not have any help in my neighborhood. Sure you can see / have the contro

[web2py] Re: row.update_record() leaves row as None (only sometimes)

2018-07-17 Thread Leonel Câmara
In virtual methods you should not use row compact notation. You should use like row.content.title instead of row.title. So the error can be there. That said can I see the original code for the controller? Are you doing something like row = row.update_record(**data)? -- Resources: - http://web2

[web2py] Re: row.update_record() leaves row as None (only sometimes)

2018-07-17 Thread Lisandro
I don't think the code for update_tsv() is related, because the traceback shows that the error is produced even before looking for that method. I mean, the error says that the "row" object is None, therefor I think it would throw error calling any method. But anyway, in case it helps to figure

[web2py] Re: row.update_record() leaves row as None (only sometimes)

2018-07-12 Thread Leonel Câmara
What virtual method? What does update_tsv do? I can guess it's related to some csv representation but that's not a regular row method. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/iss

[web2py] Re: row.update_record() leaves row as None (only sometimes)

2018-07-12 Thread Lisandro
Thank you Leonel for your time. The code I showed is a bit simplified. I do some validation in deed (to requests.vars and request.args). Even though, if there is a problem with request.vars (for example, if request.vars.age is a string that is not a digit), the update_record would throw some e

[web2py] Re: row.update_record() leaves row as None (only sometimes)

2018-07-12 Thread Leonel Câmara
You are not validating request.vars.name nor request.vars.age. Is it possible something weird is going on there? Also you're not checking if row is None initially after you get it using request.args(0). Other than that, I don't see how this is even possible. Because a None Row should cause