[web2py] register and login - extra fields

2015-05-29 Thread Martin Weissenboeck
​ A proposal to extend the register form and the login form The issue: I want to have a register form with an extra field,* which should not be part of auth_user*. The purpose: a new user can only register if this field contrains (e.g.) some special code. This code can be checked by a validation

[web2py] Re: _before_insert / update question

2015-05-29 Thread Anthony
Possible bug. What does your bulk_insert code look like? On Friday, May 29, 2015 at 1:32:35 AM UTC-4, Ian Ryder wrote: > > OK - I think I have the answer. > > I discovered it wasn't table-specific, it worked with this same method / > table elsewhere in the app. The place it was failing was using

Re: [web2py] web2py 2.11.1 is OUT

2015-05-29 Thread Massimo Di Pierro
This is strange. ANYWAY, a bug crept in so I reverted the posted "stable" version to 2.10.4 until the bug is fixed. Massimo On Friday, 29 May 2015 00:46:16 UTC-5, Gour wrote: > > Massimo Di Pierro writes: > > > web2py 2.11.1 is OUT. > > Heh, I pulled from the master yesterday and it was still

[web2py] Re: Strip Spaces

2015-05-29 Thread Niphlod
there are no functions in T-SQL accross backends that do what you ask, so you'll need to do it in python for rec in db(db.table.id >0).select(): rec.update_record(field=rec.field.strip()) On Friday, May 29, 2015 at 6:33:28 AM UTC+2, Jerry Liu wrote: > > Hello, all > > I want to update all of

[web2py] Re: Customizing registration fields for linkedin login

2015-05-29 Thread John Costantino
Just giving this a Bump. Would really love a resolution to this one. Thanks guys. On Wednesday, May 13, 2015 at 10:28:43 AM UTC-4, John Costantino wrote: > > Yes, that is correct. I added extra fields using the > auth.settings.extra_fields['']. > So the table is able to support the extra ones I

[web2py] Re: Strip Spaces

2015-05-29 Thread Derek
Yes there are, it's called the 'trim' function. It's part of SQL-92. http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt Postgres, MSSQL, MySQL, SQLite, and Oracle all have rtrim, and ltrim. I think it's widely supported and thus we should support it in DAL. It's easy enough to write a f

[web2py] Re: Customizing registration fields for linkedin login

2015-05-29 Thread Derek
What don't you understand? Step 2 - Retrieve basic profile data Once you have obtained a valid access token for the user, you can use the following REST API call to retrieve basic profile data for the user: GET https://api.linkedin.com/v1/people/~?format=json sample api response { "firstNam

[web2py] compute field with function NOT lambda

2015-05-29 Thread goome
Hello i need ta compute field, quite similar to that expesed in the book, but with a bit pre-verification before. So i need a function, not a lambda. But what is the syntax in this case? Does the function need a row as input? a need something like Field('total', *compute*=lambda r: (float(r['preco

[web2py] Re: compute field with function NOT lambda

2015-05-29 Thread goome
i've done with def func(row): and calling row['preco'] etc in it. Now the problem is that the filed is not shown in form, even if i put db.table.total.readable=True I read there there was an issue about this in the past, but how is now the situation about this? Thanks Il giorno venerdì 29 maggi

Re: [web2py] web2py 2.11.1 is OUT

2015-05-29 Thread José Ricardo Borba
@Massimo, The web2py 2.11.1 still in the box or was released? I need to test it out with my app, that use mongodb too. I'm experiencing _id troubles, and wish that was only a minor problem with mongodb adapter in the 2.10.4 release that I was updated from the pydal issue #170. Best regards. And

Re: [web2py] getting " [Errno 13] Permission denied" over and over

2015-05-29 Thread Dave S
On Thursday, May 28, 2015 at 9:33:28 PM UTC-7, Gene wrote: > > Encountered the same ticket on windows 8.1, web2py 2.9. 'Fixed' by > uninstalling McAfee, no tickets thereafter. > You might not have to uninstall; McAfee, AIUI, does provide the ability to exclude certain directories from scanning

[web2py] Re: _before_insert / update question

2015-05-29 Thread Ian Ryder
It was this: new_ilis = [] ... new_ili = { 'income': this_rg.template_income, 'income_coding': rgli.income_coding, 'amount_item': rgli.amount_item, 'quantity': rgli.quantity, 'income_source': rgli.income_source,

[web2py] Re: _before_insert / update question

2015-05-29 Thread Ian Ryder
It was this: new_ilis = [] ... new_ili = { 'income': this_rg.template_income, 'income_coding': rgli.income_coding, 'amount_item': rgli.amount_item, 'quantity': rgli.quantity, 'income_source': rgli.income_source,

[web2py] Re: compute field with function NOT lambda

2015-05-29 Thread Anthony
You need to set the "writable" attribute to True for forms. -- 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 subs

Re: [web2py] web2py 2.11.1 is OUT

2015-05-29 Thread Ron Chatterjee
More I learn other framework more I appreciate web2py. Massimo truly deserves a gold medal if not a nobel prize. On Friday, May 29, 2015 at 2:31:42 PM UTC-4, José Borba wrote: > > @Massimo, > > The web2py 2.11.1 still in the box or was released? > > I need to test it out with my app, that use mon

[web2py] Re: compute field with function NOT lambda

2015-05-29 Thread goome
Il giorno venerdì 29 maggio 2015 21:40:27 UTC+2, Anthony ha scritto: > > You need to set the "writable" attribute to True for forms. i put legacy_db.ordinipo.total.readable = True in the model (db.py). Should i put it ont the form too? In this case, how? Thanks -- Resources: - http://web2py

[web2py] Issues with _id in MongoDB

2015-05-29 Thread José Ricardo Borba
Hello all, I'm experiencing some issues with web2py and MongoDB 3.0.3 _id field. With web2py 2.10.4 the _id field (ObjectId) is showed in this way: 26418130264307745716389872944 26418130264307745716389872963 . . With Ipython 3.1.0 (with [python2.7.9 or 3.4.3 and pymongo] OR mongodb shell 3.0.3

[web2py] Re: compute field with function NOT lambda

2015-05-29 Thread Anthony
"writable", not "readable". On Friday, May 29, 2015 at 5:11:39 PM UTC-4, goome wrote: > > > > Il giorno venerdì 29 maggio 2015 21:40:27 UTC+2, Anthony ha scritto: >> >> You need to set the "writable" attribute to True for forms. > > > i put > legacy_db.ordinipo.total.readable = True > in the mod

[web2py] Re: _before_insert / update question

2015-05-29 Thread Anthony
Yes, this is a bug in bulk_insert -- it calls the _listify method *before* running the _before_insert callbacks instead of after (_listify changes the format from a dictionary to a list of (field, value) tuples). If you don't mind, please file a pydal github issue and reference this post. Antho

[web2py] Re: Email invite users - peer review

2015-05-29 Thread Carlos Zenteno
Great idea. My webapp needs something like this. Not in bulk but I can modify it to serve my needs -- 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) ---

[web2py] Select all fields with length > 0?

2015-05-29 Thread LoveWeb2py
db((db.table.field1.id>0)&(db.table.field2.length>0)).select() This still returns the whole field. I'm thinking the length takes the length of the entire field. How can I bring back all records that aren't empty for a field For example db.table.field2 row1: has information row2: row3: has in

[web2py] Re: Select all fields with length > 0?

2015-05-29 Thread LoveWeb2py
Sigh should have thought a little more before posting. Sorry about this This works: db((db.table.field1.id>0)&(db.table.field2!='')).select() On Friday, May 29, 2015 at 6:19:44 PM UTC-4, LoveWeb2py wrote: > > db((db.table.field1.id>0)&(db.table.field2.length>0)).select() > > This still return

[web2py] Re: _before_insert / update question

2015-05-29 Thread 黄祥
i face the same situation before, but because i use bulk_insert in controller install.py so that i put the conditional if on it. e.g. *models/db.py* # after_insert_purchase_detail def __after_insert_purchase_detail(f, id): db(db.dvd.id == f.dvd).update(quantity = db.dvd(f.dvd).quantity + f.quanti

[web2py] Re: Issues with _id in MongoDB

2015-05-29 Thread José Ricardo Borba
Hum... Seems that web2py converts the hex _id of ObjectId to the Loong integer that represent that number. So, this is not an issue. I need to think again... Best regards, 2015-05-29 18:22 GMT-03:00 José Ricardo Borba : > Hello all, > > I'm experiencing some issues with web

[web2py] Re: Email invite users - peer review

2015-05-29 Thread James Burke
I've submitted a pull request under the username Peregrinius. As noted my initial code relies on register_bare, which seems to have since been removed. On Thursday, May 28, 2015 at 5:19:07 PM UTC+12, Massimo Di Pierro wrote: > > think this is an excellent idea. Please submit a pull request. > >

[web2py] Re: Issues with _id in MongoDB

2015-05-29 Thread José Ricardo Borba
Closing with success If more people need to import data from CSV files and need to reference other collections in MongoDB, just prepare the file in the way described below (recipe). In a separate file (py) do this - search your term in MongoDB collection of your choice; - convert the _id in i