[web2py] Re: update crud form

2016-03-30 Thread 'Laer Cius' via web2py-users
Ok thanks ! 

As a matter of fact I have indeed an unique option set for the problematic 
values. But I understood it as to prevent 2 same values for 2 different 
users : as for an email for example. But here I try to update the profile 
of the same user so obviously he should keep the same email or be able to 
anyway.

I join the faulty code.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
# -*- coding: utf-8 -*-
cache.ram.clear()
cache.disk.clear()


@auth.requires_login()
def index():
administrator = True
# verify if user is manager to be able to access administration menu
for row in db(db.auth_user.first_name == db.auth_user.first_name).select():
administrator   = row.is_manager
first_name  = row.first_name
last_name   = row.last_name
nickname= row.nickname
email   = row.email
address = row.address
postcode= row.postcode
city= row.city
country = row.country
website = row.website

# expose profile
db.auth_user.first_name.default = first_name
db.auth_user.last_name.default  = last_name
db.auth_user.nickname.default   = nickname
db.auth_user.email.default  = email
db.auth_user.address.default= address
db.auth_user.postcode.default   = postcode
db.auth_user.city.default   = city
db.auth_user.country.default= country
db.auth_user.website.default= website

# TODO : CRUD TO READ
from gluon.tools import Crud
crud = Crud(db)

form = crud.update(db.auth_user, request.args(0))

if form.process(keepvalues=True, dbio=True).accepted:
response.flash = 'Your data has been updated'
elif form.errors:
response.flash = 'Some errors have been encountered ! Please contact your administrator.'

return dict(administrator=administrator, navbar_disable=False, form=form)


def user():
# CONTEXT DICTIONARY
context = {}

# DELETE COOKIES WHEN LOGOUT
if request.args[0] == 'logout':
for cookie_name in ['session_id_welcome', 'session_id_forums']:
response.cookies[cookie_name] = 'invalid'
response.cookies[cookie_name]['expires'] = -10
response.cookies[cookie_name]['path'] = '/'

# ENABLE REGISTER
if request.args[0] == 'register':
# ### VERIFICATION EMAIL
mail_config = {
'title': auth.default_messages.get('verify_email_subject'),
'subject_title': 'Verification email process..',
'verification_url': URL('default', 'user', scheme='http', args=['verify_email']) + '/%(key)s',
'verification_url_on_site': URL('default', 'browser_email', scheme='http') + '?key=%(key)s',
'verification_url_on_site_enabled': True,
'main_title_enabled': False,
'secondary_title_enabled': False,
'verify_email_block_enabled': True,
'spacer': URL('static', 'images/spacer.gif', scheme='http'),
}

auth.messages.verify_email = response.render('templates/email_verification.html', mail_config)

# AND LAST, RETURN FORM IN DICT
context['form'] = auth()

return context


def browser_email():

mail_config = dict(
title=auth.default_messages.get('verify_email_subject'),
subject_title='Verification email process..',
verification_url=URL('default', 'user', scheme='http',
 args=['verify_email']) + '/' + request.vars['key'],
verification_url_on_site='',
verification_url_on_site_enabled=False,
illustration_image_enabled=False,
main_title_enabled=False,
secondary_title_enabled=False,
verify_email_block_enabled=True,
spacer=URL('static', 'images/spacer.gif', scheme='http'),
)

return response.render('templates/email_verification.html', mail_config)

# -*- coding: utf-8 -*-
# File is released under public domain and you can use without limitations

# auto-reload modules when changes are made
from gluon.custom_import import track_changes
track_changes(True)

# app configuration made easy, look inside private/appconfig.ini
from gluon.contrib.appconfig import AppConfig

# TODO : once in production, remove reload=True to gain full speed
my_conf = AppConfig(reload=True)

# connect to database
db = DAL(my_conf.take('db.uri'))

# necessary various imports
from gluon.tools import Auth, Service, PluginManager
auth= Auth(db)
service = Service()

[web2py] Re: Why is id field not hiding here at all in the form displaying?

2016-03-30 Thread 'DenesL' via web2py-users
You don't need that script to hide the id, just set the showid param in 
SQLFORM to False.
See the signature of the SQLFORM constructor:
http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM

Denes


On Wednesday, March 30, 2016 at 4:00:13 PM UTC-4, Jacob Devin wrote:
>
> def screen():
> dpform=SQLFORM(db.info,row.id,fields=['dp']).process()
> return locals()
>
> def delformforscreen():
> row=db(db.info.info_id==auth.user_id).select().first()
> 
> form=SQLFORM(db.info,row.id,fields=['first_name','last_name','dob','sex','hometown',
>  
> 'highschool', 'university', 'oneself']).process()
> return locals()
>
> in view:
> default/delformforscreen.load
> 
> jQuery(document).ready(function(){
>   jQuery('#info_id__row').hide();
> jQuery('#info_id__row').hide();
> });
> 
> {{=form}}
>
> in default/screen.html:
>
> {{extend 'layout.html'}}
> {{=dpform}}
>{{=LOAD('default', 'delformforscreen.load', ajax=True)}}
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: update crud form

2016-03-30 Thread 'Laer Cius' via web2py-users


Le mercredi 30 mars 2016 21:52:02 UTC+2, Laer Cius a écrit :
>
> Hi,
>
> I would like to be sure of something : I want to update the database 
> through a crud.update() form but when I do so, I have some "value already 
> exists in database" errors. And I couldnt find a way to say to web2py to 
> update only if changed or absent.. Which I thought the update form was 
> doing by default. But maybe I just missed it.
>
> So, I'd like to know if it is normal web2py behaviour and I have to show 
> and handle errors I need with form.errors or do I definitely miss something 
> ?
>
> Thank you
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] update crud form

2016-03-30 Thread Richard Vézina
You should show us some code... The issue you have seems to be cause by a
validator that make sure you don't duplicate value entry... Don't have
twice the same value for a given field...

On Wed, Mar 30, 2016 at 3:52 PM, 'Laer Cius' via web2py-users <
web2py@googlegroups.com> wrote:

> Hi,
>
> I would like to be sure of something : I want to update the database
> through a crud.update() form but when I do so, I have some "value already
> exists in database" errors. And I couldnt find a way to say to web2py to
> update only if changed or absent.. Which I thought the update form was
> doing by default. But maybe I just missed it.
>
> So, I'd like to know if it is normal web2py behaviour and I have to show
> and handle errors I need with form.errors or do I definitely miss something
> ?
>
> Thank you
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Why is id field not hiding here at all in the form displaying?

2016-03-30 Thread Jacob Devin
def screen():
dpform=SQLFORM(db.info,row.id,fields=['dp']).process()
return locals()

def delformforscreen():
row=db(db.info.info_id==auth.user_id).select().first()

form=SQLFORM(db.info,row.id,fields=['first_name','last_name','dob','sex','hometown',
 
'highschool', 'university', 'oneself']).process()
return locals()

in view:
default/delformforscreen.load

jQuery(document).ready(function(){
  jQuery('#info_id__row').hide();
jQuery('#info_id__row').hide();
});

{{=form}}

in default/screen.html:

{{extend 'layout.html'}}
{{=dpform}}
   {{=LOAD('default', 'delformforscreen.load', ajax=True)}}

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] update crud form

2016-03-30 Thread 'Laer Cius' via web2py-users
Hi,

I would like to be sure of something : I want to update the database 
through a crud.update() form but when I do so, I have some "value already 
exists in database" errors. And I couldnt find a way to say to web2py to 
update only if changed or absent.. Which I thought the update form was 
doing by default. But maybe I just missed it.

So, I'd like to know if it is normal web2py behaviour and I have to show 
and handle errors I need with form.errors or do I definitely miss something 
?

Thank you

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Date picker format

2016-03-30 Thread Ron Chatterjee
Dr. Pierro,

Couldn't agree more.



On Wednesday, March 30, 2016 at 11:43:22 AM UTC-4, Jeff Riley wrote:
>
> Mr. Pierro,
>
> Web2py has been a joy to work with and I am really looking forward to 
> Web3py.  All my best.
>
> On Tuesday, March 29, 2016 at 4:27:11 PM UTC-5, Massimo Di Pierro wrote:
>>
>> LOL. I think it is not easy enough in fact. In web3py I think all date 
>> conversions should be done client side and not in validator. There is no 
>> reason for the server to even know what the client representation of dates 
>> is.
>>
>> On Tuesday, 29 March 2016 12:44:54 UTC-5, Jeff Riley wrote:
>>>
>>> Mr. Pierro.  I am embarrassed that was so easy.
>>>
>>> On Monday, March 28, 2016 at 11:09:32 PM UTC-5, Massimo Di Pierro wrote:

 look into views/web2py_ajax.html

 On Monday, 28 March 2016 16:09:39 UTC-5, Jeff Riley wrote:
>
> Hello everyone.  I have the following field defined.
>
> Field('due_date', 'date', requires = IS_DATE(format=T('%m-%d-%Y'))),
>
> The date picker that comes up with this field is setting the date to 
> -MM-DD which is conflicting with the format I have defined above when 
> I 
> his submit.  How to I get the date picker to return the correct format.
>
> Thank you all so much for all your help with everything I have asked.
>


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] checkboxes framework7.io and validate

2016-03-30 Thread 'DenesL' via web2py-users
Hi

while creating some pages with framework7 I noticed that the checkbox 
inputs were not validating.

On a closer look I noticed that they where being submitted as 
checkbox_name[] instead of just checkbox_name.

I tried to fix the issue by replacing the offending vars in request.vars 
with their non-square-bracketed versions but validate seems to work with 
different copy of them.

Has anybody encountered something similar?.

Thanks,
Denes

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Create links in smartgrid for the child

2016-03-30 Thread Alessio Varalta
Hi I have a smartgrid with one child and i want a to add links to my child 
is possibile for example:

I have entity dashboard with a child label_dashboard

So i create the smartgrid 

grid = SQLFORM.smartgrid(db.dashboard,linked_tables=['label_dashboard'])

Now I want to add links to label_dashboard is possible? When in the grid i 
go to label_dashboard i want for every row a link button for go to a 
page..I know how use the link button in a grid but for the smartgrid?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Date picker format

2016-03-30 Thread Jeff Riley
Mr. Pierro,

Web2py has been a joy to work with and I am really looking forward to 
Web3py.  All my best.

On Tuesday, March 29, 2016 at 4:27:11 PM UTC-5, Massimo Di Pierro wrote:
>
> LOL. I think it is not easy enough in fact. In web3py I think all date 
> conversions should be done client side and not in validator. There is no 
> reason for the server to even know what the client representation of dates 
> is.
>
> On Tuesday, 29 March 2016 12:44:54 UTC-5, Jeff Riley wrote:
>>
>> Mr. Pierro.  I am embarrassed that was so easy.
>>
>> On Monday, March 28, 2016 at 11:09:32 PM UTC-5, Massimo Di Pierro wrote:
>>>
>>> look into views/web2py_ajax.html
>>>
>>> On Monday, 28 March 2016 16:09:39 UTC-5, Jeff Riley wrote:

 Hello everyone.  I have the following field defined.

 Field('due_date', 'date', requires = IS_DATE(format=T('%m-%d-%Y'))),

 The date picker that comes up with this field is setting the date to 
 -MM-DD which is conflicting with the format I have defined above when 
 I 
 his submit.  How to I get the date picker to return the correct format.

 Thank you all so much for all your help with everything I have asked.

>>>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: advice: multiple tables on a single form

2016-03-30 Thread billmackalister
On that note, I always wonder if two tables can be placed in one form using 
formfactory, but horizontally, not vertically. Is any link anyone can share?

On Wednesday, March 30, 2016 at 9:50:20 AM UTC-4, lucas wrote:
>
> yes, that will work quite well.  not perfectly because i do have one table 
> that requires two parallel entries, but this certainly does give an 
> excellent jump start.  thanx anthony, lucas
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: rediect after login when use decorators "@auth.requires_login"

2016-03-30 Thread killzane
Thanks about explain it.

this is code in my controller "default.py"

@auth.required_login()
def foo():
return 'this requires login' 

I use these code for visitor auto redirect to login page.
and web2py will auto add *_next* variable then I can't use 
*auth.settings.login_next 
*to redirect location.
so how to let web2py *don't *auto add _next variable by use 
@auth.required_login()? 

Anthony於 2016年3月30日星期三 UTC+8下午8時54分30秒寫道:
>
> On Wednesday, March 30, 2016 at 4:06:41 AM UTC-4, killzane wrote:
>>
>> I use *@auth.requires_login()* in my controller
>> and when I visit that page, I will auto go to login page and have the 
>> "_next URL parameter"
>>
>> I want to use 
>> auth.settings.login_next = URL('default', 'router')
>>
>> according to this page 
>> 
>>  I 
>> need to set *referrer_actions *but I don't know where should I put this 
>> code?
>> or It has other way to do it?
>>
>
> auth.settings.login_next is the default redirect location in case there is 
> *no* _next variable in the URL query string -- so that should already 
> work without any _next variable. By default, the auth.navbar adds a _next 
> variable to the login URL when the login link is clicked (so the user will 
> be redirected back to the page they were on before logging in) -- the _next 
> variable in the URL takes precedence over the auth.settings.login_next 
> setting, which only serves as a default. If you want to prevent auth.navbar 
> from adding the _next variable, you can use auth.navbar(..., 
> referrer_actions=None) wherever you have inserted the navbar (most likely 
> this would be in your layout.html). If that is not your goal, please 
> explain the behavior you are looking for and what you are seeing instead.
>
> Anthony 
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: advice: multiple tables on a single form

2016-03-30 Thread lucas
yes, that will work quite well.  not perfectly because i do have one table 
that requires two parallel entries, but this certainly does give an 
excellent jump start.  thanx anthony, lucas

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: rediect after login when use decorators "@auth.requires_login"

2016-03-30 Thread Anthony
On Wednesday, March 30, 2016 at 4:06:41 AM UTC-4, killzane wrote:
>
> I use *@auth.requires_login()* in my controller
> and when I visit that page, I will auto go to login page and have the 
> "_next URL parameter"
>
> I want to use 
> auth.settings.login_next = URL('default', 'router')
>
> according to this page 
> 
>  I 
> need to set *referrer_actions *but I don't know where should I put this 
> code?
> or It has other way to do it?
>

auth.settings.login_next is the default redirect location in case there is 
*no* _next variable in the URL query string -- so that should already work 
without any _next variable. By default, the auth.navbar adds a _next 
variable to the login URL when the login link is clicked (so the user will 
be redirected back to the page they were on before logging in) -- the _next 
variable in the URL takes precedence over the auth.settings.login_next 
setting, which only serves as a default. If you want to prevent auth.navbar 
from adding the _next variable, you can use auth.navbar(..., 
referrer_actions=None) wherever you have inserted the navbar (most likely 
this would be in your layout.html). If that is not your goal, please 
explain the behavior you are looking for and what you are seeing instead.

Anthony 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: advice: multiple tables on a single form

2016-03-30 Thread Anthony
Have you tried this method: 
http://web2py.com/books/default/chapter/29/07/forms-and-validators#One-form-for-multiple-tables

Anthony

On Wednesday, March 30, 2016 at 8:03:24 AM UTC-4, lucas wrote:
>
> hello one and all,
>
> so i would like to ask advice.  i know that you can have multiple SQLFORMS 
> on a single view and with web2py serialization it works fine, for each 
> separate form has a separate submit button.
>
> but what if you wanted to merge certain fields from four different tables 
> into a single form and a single view and have a single submit button?
>
> what is web2py's best method for doing this?
>
> i was thinking manually create a FORM with the fields and then when 
> submitted, parse out the fields to each table.  but is there a better way 
> that is less manual or labor intensive?
>
> thanx in advance and have a great day, lucas 
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] advice: multiple tables on a single form

2016-03-30 Thread lucas
hello one and all,

so i would like to ask advice.  i know that you can have multiple SQLFORMS 
on a single view and with web2py serialization it works fine, for each 
separate form has a separate submit button.

but what if you wanted to merge certain fields from four different tables 
into a single form and a single view and have a single submit button?

what is web2py's best method for doing this?

i was thinking manually create a FORM with the fields and then when 
submitted, parse out the fields to each table.  but is there a better way 
that is less manual or labor intensive?

thanx in advance and have a great day, lucas 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] OFF Topic - Cycle.js

2016-03-30 Thread António Ramos
Can i have some opinions on this new thing?

http://cycle.js.org/

thank you

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: I want to make a query this way but unfortunately this ain't working. How to fix?

2016-03-30 Thread Leonel Câmara
This is probably what you want
 
rows=db((db.info.last_name.like('%' + request.args(0) + ' %', 
case_sensitive=False)) | (db.info.last_name.like('%' + request.args(0) + 
'%', case_sensitive=False))).select()

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web2py 2.14.2

2016-03-30 Thread Sukrut Joshi
thanku


On Wed, Mar 30, 2016 at 3:58 PM, Gary Cowell  wrote:

> Hello
>
> Running 2.14.3 - upgraded from 2.12.(something)
>
> Seems all the btn-default are now almost invisible?
>
> E.g. from the log in page:
>
>  onclick="window.location='/dynamic54/default/user/register?_next=%2Fdynamic54%2Fdynamic%2Flist_systems';return
> false">Sign Up
>
> Gives me
>
>
>
> now.
>
> I upgraded web2py, then copied the static/js and static/css from welcome
>
> I notice bootstrap version changed from 3.3.4 to 3.3.5. button style has
> changed also.
>
> Did I do something wrong during upgrade? What might be the problem?
>
> Thanks
>
>
>
>
> On Thursday, 24 March 2016 22:56:23 UTC, Massimo Di Pierro wrote:
>>
>> http://web2py.com/
>>
>> First of all many many thanks to Simone (niphlod), Richard, and Leonel.
>> Most of the work is theirs.
>>
>> It is important that you upgrade because we fixed some serious security
>> bugs that may leak your admin password (if you use rocket and expose the
>> old example app).
>>
>> We fixed many many bug and in particular everything should work fine on
>> GAE now, including Datastore and Cloud SQL.
>>
>> ** IMPORTANT: We also strongly recommend that you do not expose the
>> examples app if you do not have to. Although all known security issue have
>> been fixed in the new examples app, there may be issue with your legacy
>> examples app.**
>>
>> CHANGELOG
>>
>> - fixed two major security issues that caused the examples app to leak
>> information
>>
>> - new Auth(…,host_names=[…]) to prevent host header injection
>>
>> - improved scheduler
>>
>> - pep8 enhancements
>>
>> - many bug fixes
>>
>> - restored GAE support that was broken in 2.13.*
>>
>> - improved fabfile for deployment
>>
>> - refactored examples with stupid.css
>>
>> - new JWT implementation (experimental)
>>
>> - new gluon.contrib.redis_scheduler
>>
>> - myconf.get
>>
>> - LDAP groups (experimental)
>>
>> - .flash -> .w2p_flash
>>
>> - Updated feedparser.py 5.2.1
>>
>> - Updated jQuery 1.12.2
>>
>> - welcome app now checks for version number
>>
>> - Redis improvements.
>>
>>
>> BEFORE:
>>
>> from gluon.contrib.redis_cache import RedisCache
>>
>> cache.redis = RedisCache('localhost:6379',db=None, debug=True)
>>
>>
>> NOW:
>>
>> from gluon.contrib.redis_utils import RConn
>>
>> from gluon.contrib.redis_cache import RedisCache
>>
>> rconn = RConn()
>>
>> # or RConn(host='localhost', port=6379,
>>
>> # db=0, password=None, socket_timeout=None,
>>
>> # socket_connect_timeout=None, .)
>>
>> # exactly as a redis.StrictRedis instance
>>
>> cache.redis = RedisCache(redis_conn=rconn, debug=True)
>>
>> BEFORE:
>>
>> from gluon.contrib.redis_session import RedisSession
>>
>> sessiondb = RedisSession('localhost:6379',db=0, session_expiry=False)
>>
>> session.connect(request, response, db = sessiondb)
>>
>>
>> NOW:
>>
>> from gluon.contrib.redis_utils import RConn
>>
>> from gluon.contrib.redis_session import RedisSession
>>
>> rconn = RConn()
>>
>> sessiondb = RedisSession(redis_conn=rconn, session_expiry=False)
>>
>> session.connect(request, response, db = sessiondb)
>>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py 2.14.2

2016-03-30 Thread Gary Cowell
Hello

Running 2.14.3 - upgraded from 2.12.(something)

Seems all the btn-default are now almost invisible?

E.g. from the log in page:

Sign Up

Gives me



now.

I upgraded web2py, then copied the static/js and static/css from welcome 

I notice bootstrap version changed from 3.3.4 to 3.3.5. button style has 
changed also.

Did I do something wrong during upgrade? What might be the problem?

Thanks



On Thursday, 24 March 2016 22:56:23 UTC, Massimo Di Pierro wrote:
>
> http://web2py.com/
>
> First of all many many thanks to Simone (niphlod), Richard, and Leonel. 
> Most of the work is theirs.
>
> It is important that you upgrade because we fixed some serious security 
> bugs that may leak your admin password (if you use rocket and expose the 
> old example app).
>
> We fixed many many bug and in particular everything should work fine on 
> GAE now, including Datastore and Cloud SQL.
>
> ** IMPORTANT: We also strongly recommend that you do not expose the 
> examples app if you do not have to. Although all known security issue have 
> been fixed in the new examples app, there may be issue with your legacy 
> examples app.**
>
> CHANGELOG
>
> - fixed two major security issues that caused the examples app to leak 
> information
>
> - new Auth(…,host_names=[…]) to prevent host header injection
>
> - improved scheduler
>
> - pep8 enhancements
>
> - many bug fixes
>
> - restored GAE support that was broken in 2.13.*
>
> - improved fabfile for deployment
>
> - refactored examples with stupid.css
>
> - new JWT implementation (experimental)
>
> - new gluon.contrib.redis_scheduler
>
> - myconf.get
>
> - LDAP groups (experimental)
>
> - .flash -> .w2p_flash
>
> - Updated feedparser.py 5.2.1
>
> - Updated jQuery 1.12.2
>
> - welcome app now checks for version number
>
> - Redis improvements.
>
>
> BEFORE:
>
> from gluon.contrib.redis_cache import RedisCache
>
> cache.redis = RedisCache('localhost:6379',db=None, debug=True)
>
>
> NOW:
>
> from gluon.contrib.redis_utils import RConn
>
> from gluon.contrib.redis_cache import RedisCache
>
> rconn = RConn()
>
> # or RConn(host='localhost', port=6379,
>
> # db=0, password=None, socket_timeout=None,
>
> # socket_connect_timeout=None, .)
>
> # exactly as a redis.StrictRedis instance
>
> cache.redis = RedisCache(redis_conn=rconn, debug=True)
>
> BEFORE:
>
> from gluon.contrib.redis_session import RedisSession
>
> sessiondb = RedisSession('localhost:6379',db=0, session_expiry=False)
>
> session.connect(request, response, db = sessiondb)
>
>
> NOW:
>
> from gluon.contrib.redis_utils import RConn
>
> from gluon.contrib.redis_session import RedisSession
>
> rconn = RConn()
>
> sessiondb = RedisSession(redis_conn=rconn, session_expiry=False)
>
> session.connect(request, response, db = sessiondb)
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How did you implement chat system in your app? How's my idea?

2016-03-30 Thread Leonel Câmara
You could use server sent events if you don't have many users.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] rediect after login when use decorators "@auth.requires_login"

2016-03-30 Thread killzane
I use *@auth.requires_login()* in my controller
and when I visit that page, I will auto go to login page and have the 
"_next URL parameter"

I want to use 
auth.settings.login_next = URL('default', 'router')

according to this page 

 I 
need to set *referrer_actions *but I don't know where should I put this 
code?
or It has other way to do it?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.