Re: [web2py] Re: New feature in trunk conditional fields RFC

2017-01-06 Thread Meinolf
Hello How do i implement these conditional fields in a custom auth table? I tried the following but does not seem to hide the grade field. #Start of definition of custom Auth tables to be used instead of the default ones. auth = Auth(db) db.define_table(auth.settings.table_user_name,

[web2py] Re: Check to establish whether or not a record exists

2016-11-20 Thread Meinolf
Hi Massimo Just came across this post and got a bit alarmed, so when i check if a record exists i don't have to use the usual '==' but instead '=' ? On Monday, October 10, 2011 at 3:55:27 PM UTC+2, Massimo Di Pierro wrote: > > row = db.postcode_cache(postcode=postcode) > if not row: > db.postc

[web2py] Re: Web2py Update records only if user is signed in with a different session from previous

2016-10-05 Thread Meinolf
gt; On Tuesday, October 4, 2016 at 3:16:06 AM UTC-4, Meinolf wrote: >> >> Hi there, >> >> I need to update my table record only if the user is logged in with a >> different session from the previous, but with the code i have, it keeps >> updating when i thou

[web2py] Web2py Update records only if user is signed in with a different session from previous

2016-10-04 Thread Meinolf
Hi there, I need to update my table record only if the user is logged in with a different session from the previous, but with the code i have, it keeps updating when i thought the user still logged in with the same session. problem is i can't view the session id which seem to be encrypted, i ca

[web2py] Re: Passing a list as query parameter and storing the retrieved rows in a list

2016-09-27 Thread Meinolf
wrote: > > On Wednesday, September 21, 2016 at 3:30:49 AM UTC-4, Meinolf wrote: >> >> OMG, Is this normal? >> i got chills telling me it had something to do with the *For Loop*, >> played around with the LBs and UBs and the following worked: >> >>

[web2py] Re: Passing a list as query parameter and storing the retrieved rows in a list

2016-09-21 Thread Meinolf
hat i know of starting from 0. On Monday, September 19, 2016 at 7:59:27 PM UTC+2, Meinolf wrote: > > Hi There, > > When i test the code below, for a list that is supposed to have multiple > items, i only get one result for the last item, did i miss something in the > for loop or

[web2py] Re: Passing a list as query parameter and storing the retrieved rows in a list

2016-09-21 Thread Meinolf
r perhaps a bit longer, something like this... > > rows = db( db.item.id.belongs(getcourseids.values()) ).select( >db.item.course_title) > > s = [r.course_title for r in rows] > > > > On Monday, 19 September 2016 18:59:27 UTC+1, Meinolf wrote: >> >&

[web2py] Passing a list as query parameter and storing the retrieved rows in a list

2016-09-19 Thread Meinolf
Hi There, When i test the code below, for a list that is supposed to have multiple items, i only get one result for the last item, did i miss something in the for loop or anywhere else? for i in range(0, (len(getcourseids)-1)): c = db.item.id==getcourseids[i].item_id s.a

Re: [web2py] extracting a field value from a row gives me

2016-09-19 Thread Meinolf
subbaraman.wordpress.com/about/ > > On Mon, 19-09-2016 11:51 AM, Meinolf wrote: > > What could be wrong with my code below? > > sim = db((db.rates.item_id==request.args(0)) & ~(db.rates.user_id== > auth.user.id)).select(db.rates.clicks.max()).first().clicks > > I ne

[web2py] extracting a field value from a row gives me

2016-09-18 Thread Meinolf
What could be wrong with my code below? sim = db((db.rates.item_id==request.args(0)) & ~(db.rates.user_id==auth.user.id)).select(db.rates.clicks.max()).first().clicks I need to access the value of the field *clicks* so that i can use it as a parameter in another query. It keeps giving me --

[web2py] Re: Web2py - How to update a table field appending a string to an existing field value

2016-09-18 Thread Meinolf
db.rated_items.id > ==k).update(search_term=db.rated_items.search_term+'b') > > >>> print db.rated_items[k] > > > > > you probably have None into the search_term field and it cannot be > concatenated with string. > > On Friday, 16 September 201

[web2py] Re: Web2py - How to update a table field appending a string to an existing field value

2016-09-16 Thread Meinolf
eld('user_id', 'reference auth_user', default=auth.user and auth.user.id), Field('item_id', 'integer'), Field('clicks', 'integer', default=0), migrate=True, ) On Friday, September 16, 2016 at 12:00:09 AM UTC+2, Meinolf wro

[web2py] Web2py - How to update a table field appending a string to an existing field value

2016-09-15 Thread Meinolf
Hi there So far i only know how to update a record by replacing the old field value with the new value. Suppose i want to append the search_term string value the corresponding text field so that both values are stored, how can i do that in this code: myrow = db((db.rated_items.user_id==auth.us

[web2py] Re: Web2py sqlite select database records using wildcards

2016-09-12 Thread Meinolf
ote: > > > > On Monday, September 12, 2016 at 12:39:17 PM UTC-7, Meinolf wrote: >> >> Anyone knows the web2py's sqlite syntax to select database records using >> wildcards such as %like% or contains instead of query = db.mytable.myfield >> == 'value'

[web2py] Re: Web2Py Navigating table records one at a time

2016-09-12 Thread Meinolf
resolved, i completely changed the approach to something else. -- 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 s

[web2py] Web2py sqlite select database records using wildcards

2016-09-12 Thread Meinolf
Anyone knows the web2py's sqlite syntax to select database records using wildcards such as %like% or contains instead of query = db.mytable.myfield == 'value'? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://co

[web2py] Re: Web2Py Navigating table records one at a time

2016-09-02 Thread Meinolf
Now i have changed the idea. My new idea is to track users' activity as they search for study courses, depending on their search terms, i want to recommend to them some courses they might be interested in. Any idea of which tools in Web2Py i can make use of and how to use them: Auth, session o

[web2py] Web2Py Navigating table records one at a time

2016-08-16 Thread Meinolf
Hi I am new to python and web2py. I have a small sqlite table of "career test" questions that i need to be presented to a user in form of a quiz, one question appearing at a time Problems: 1. I can't figure out how to safely stop at the last record, it breaks and after 3 more clicks, it takes m