some notes:
- comparison with True and False **should** be done with True and False
against a 'boolean' field. However I see that you're declaring those fields
as strings, so its technically correct treating those as strings although
kinda silly ^_^
- cacheable=True **strips** from the Row object any "bells and whistles" to
be able to cache it from an outside module (select(cache=True) does this by
default) AND to leverage some speedups in case delete_record(),
update_record() and automatic FK are not needed. It's ok, expected and
documented that trying to do an update_record() on a Row fetched with
cacheable=True will **not** work.
- the latest update you posted **should** result in an update, although
given my first point it should be really
.....update(NonCompliant = 'True')
- no real need to separate queries on multiple lines with & and \ . Just &
is fine, because you've an additional set of parenthesis around
- try to print that update statement and execute it against your backend in
something that isn't web2py to see if it actually results in an update. To
print pretty every SQL statement issued by web2py, just prefix the "call"
with an underscore.
- given all the things said, do a
print db(
(db.Participant.CardNumber==form3.vars.unionid3) &
(db.Participant.IsUnemployed=='False') &
(db.Participant.Consent=='True')
)._update(NonCompliant='False')
to see what statement is issued to your backend.
Don't know if the following is needed (needs at least some skill in
SQL-ese) but - at least for newbies - :
the previous print will probably result in an
UPDATE Partecipant
SET NonCompliant = 'False'
WHERE blablablabla
to see if the record indeed exists in your table, just switch that
statement into an
SELECT *
FROM Partecipant
WHERE blablablabla
i.e. keep the WHERE condition intact
--
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/groups/opt_out.