[web2py] Re: Select query returns value with type

2016-10-26 Thread Anthony
The DAL parses all integer values into Python *long* integers . The representation of long integers includes a trailing "L", but the "L" is not included when converting to a string: >>> mylongint = long(5) >>

[web2py] Select query returns value with type

2016-10-26 Thread xgp . latino
Hi all, Got this query: for row in db().select( db.X.YY.year(), distinct=True, orderby=db.X.YY.year(), ): ayears.append( row[ db.X.YY.year() ] ) count = db( db.X.YY.year() == row( db.X.YY.year() ) ).count() Don't know why all rows return the

Re: [web2py] Setting up nginx to enable CORS for a specific function?

2016-10-26 Thread Michele Comitini
You can do that easily in web2py... Below is a sample of a decorator that allows any origin. Change it to fit your needs. You can use in a controller like: @cors_allow def action(): . . . return dict(...) -- def cors_origin(): origin = request.env.http_origin

[web2py] Setting up nginx to enable CORS for a specific function?

2016-10-26 Thread Spokes
This isn't necessarily a web2py-specific question, but perhaps there's a web2py-specific solution that's preferable to other solutions, so I thought I'd ask it here. I have some HTML code and javascript, which I'd like to be able to paste into any website, and which should access an API endpoin

[web2py] Re: https and stripe

2016-10-26 Thread Jaimee S
OK, that warning would definitely cost me customers. I'll get right on that ssl right away. Thanks for the big tips! -- 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 I

[web2py] Re: SQLFORM grid search : Get ids of filtered records

2016-10-26 Thread Anthony
Note, the "searchable" argument can be a custom callable -- so, you can create a custom function that first calls the default internal query builder to get the query that filters the records, then run the update using that query, and then simply return the query for use by the grid. Here is an

[web2py] Re: https and stripe

2016-10-26 Thread Anthony
On Wednesday, October 26, 2016 at 3:08:41 AM UTC-4, Jaimee S wrote: > > interesting, so what you're saying is that once i deploy to python > anywhere ill no longer have any problems with setting up Nginx. Great! Will > the payment part of my website still be accessible, just not trusted, > witho

Re: [web2py] Re: Deployment question

2016-10-26 Thread Jim Steil
The config I'm using is the one that comes from the web2py installer for ubuntu/nginx/uwsgi in the scripts directory. So, if that were the case, I think more people would be seeing it too. -Jim On Wed, Oct 26, 2016 at 9:06 AM, Richard Vézina wrote: > Version of soft are not so differents so co

Re: [web2py] Re: update_or_insert does not return id of record ?!

2016-10-26 Thread Anthony
On Wednesday, October 26, 2016 at 4:07:45 AM UTC-4, Ramos wrote: > > but there were no record to update. it should have created a record. > as i said i created a rruid field in an existing table and the first time > i run the update_or_insert the rruid field of all the records were empty. > Here'

Re: [web2py] Re: Deployment question

2016-10-26 Thread Richard Vézina
Version of soft are not so differents so config may still be used without changes, but this should be double check... For instance, for me, config had change significantly since 12.04 related to systemd... Nginx not much but uwsgi has change. It may wise to check for deprecated uwsgi parameter flag

[web2py] Re: tasks hierarchy

2016-10-26 Thread Pierre
yes i am aware of the scheduler new deps feature this would require to know every single task id to build the parent children relation I don't know what's in the queue, tasks are queued in arbitrary order and the queue evolves constantly so i can't scan single task ids alltogether the scheduler

Re: [web2py] Migrate integer field to string type

2016-10-26 Thread Richard Vézina
Yes is you do it within the shell you better commit every 100 records depending of the size of the record, but since it just a single column and integer you can commit even every 500-1000 records I guess without issue... To do so you can use this snippet : for i, r in enumerate(db.select()):

[web2py] Re: order by the greater of 2 fields

2016-10-26 Thread Anthony Smith
On Wednesday, 26 October 2016 15:25:35 UTC+11, Anthony wrote: > > Hi all, >> This gets the results using sql but only able to do one or the other is >> the controller in web2py >> select * from animalTask order by >> GREATEST(COALESCE(withhold_until_date,0),COALESCE(esi_withhold_until_date,0))

Re: [web2py] Re: Web2py tool : Send emails to multiple user on schedule basis

2016-10-26 Thread Dave S
On Tuesday, August 16, 2016 at 11:00:11 AM UTC-7, Dave S wrote: > > > > On Tuesday, August 16, 2016 at 4:58:11 AM UTC-7, madhu nomula wrote: >> >> Thank you. >> I moved the code to Model. But could you please share me steps that >> how to schedule(trigger) it send emails. >> >> > I thought my

Re: [web2py] Re: update_or_insert does not return id of record ?!

2016-10-26 Thread António Ramos
but there were no record to update. it should have created a record. as i said i created a rruid field in an existing table and the first time i run the update_or_insert the rruid field of all the records were empty. Anyway i solved without update_or_insert... 2016-10-26 5:23 GMT+01:00 Anthony :

[web2py] Re: https and stripe

2016-10-26 Thread Jaimee S
interesting, so what you're saying is that once i deploy to python anywhere ill no longer have any problems with setting up Nginx. Great! Will the payment part of my website still be accessible, just not trusted, without an ssl certificate? On Wednesday, October 26, 2016 at 1:56:04 AM UTC-5, A