[web2py] DAL counts / groupby

2015-11-12 Thread Jason Solack
Hello everyone, I have a few tables structured like this: db.define_table('question_table', Field('qid'), Field('display_text'), ) db.define_table('answer_table', Field('qid'), Field('value'),

[web2py] Re: Creating web apps with Web2py in Azure Web Apps

2015-11-12 Thread Niphlod
+1 +1 +1 +1 this should go in web2pyslices.com (although the venv machinery is not strictly necessary, it's a "nice to have") On Thursday, November 12, 2015 at 10:09:36 PM UTC+1, Nbush wrote: > > Hi all, > > just want to share web2py setup Azure Web Apps. > > Based on >

[web2py] Re: securing download function

2015-11-12 Thread Anthony
Assuming db.foo has a field called "auth_user" that is a reference to the db.auth_user table and includes the ID of the user that owns the file, then your pseudo-code is also the actual code. Alternatively, you could use the Auth permissions functionality, which would involve assigning a

[web2py] Re: Indexes

2015-11-12 Thread Niphlod
It's backend's job to know if it's "better" to use the index or to proceed as normal. It's normally referred as "query optimizer stage". In SOME backends you can issue rather specific sql "hints" to "optimize yourself" (if you think you're smarter than your backend) the query, but being that

[web2py] Re: web2py on Microsoft Azure PAAS

2015-11-12 Thread Nbush
https://groups.google.com/forum/#!topic/web2py/XGxM_Tb9nJ4 вторник, 10 февраля 2015 г., 15:03:15 UTC+3 пользователь Gary Cowell написал: > > Anyone any experience on deploying a web2py app on Microsoft Azure Web? > > Can it be done? > -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: Indexes

2015-11-12 Thread p a
In case your question was more basic: you define indices, then just issue sql commands normally, and the database will benefit from the existence of the indices (many queries will run faster if the indices are there, but no modification is needed of the query itself). BTW, I didn't know you

[web2py] Re: securing download function

2015-11-12 Thread Niphlod
what are you afraid of ? On Thursday, November 12, 2015 at 8:25:13 PM UTC+1, Mark Billion wrote: > > Im not sure if this is necessary/redundant, but here is my question: > > Is there any way to check permission for the download -- i.e., the client > associated with the file is checked and

[web2py] Creating web apps with Web2py in Azure Web Apps

2015-11-12 Thread Nbush
Hi all, just want to share web2py setup Azure Web Apps. Based on https://azure.microsoft.com/en-us/documentation/articles/web-sites-python-configure/ 1. Create web app on Azure Portal 2. Fork a repo web2py (github) 3.* Add 4 files to own github repository (web2py/)* 4. Configure continuous

[web2py] Re: invalid field value

2015-11-12 Thread Pierre
thanks a lot Anthony you solved the "problem" web2py +++ as usual Le jeudi 12 novembre 2015 00:53:30 UTC+1, Anthony a écrit : > > On Wednesday, November 11, 2015 at 4:40:17 PM UTC-5, Pierre wrote: >> >> items = db().select(db.c_sub.ALL) >> form = SQLFORM.factory(*[Field(item.name,

[web2py] scheduler problem: stressed worker stops working

2015-11-12 Thread Manuele Pesenti
Hi! I have developed a web application using web2py with the aim of configuring little single boards so I thought to use the web interface to set up variables and configuration files and the scheduler, that run with root privileges, to apply configurations. The problem is that to have near real

[web2py] Re: TypeError: an integer is required

2015-11-12 Thread Massimo Di Pierro
Is this the best mailing list ever for web app developers? On Wednesday, 11 November 2015 12:59:55 UTC-6, Anthony Smith wrote: > > Thanks Anthony, you guys are a great assistance to all the newbies > > cheers > > On Wednesday, 11 November 2015 23:30:54 UTC+11, Anthony wrote: >> >>

[web2py] Re: Creating web apps with Web2py in Azure Web Apps

2015-11-12 Thread Massimo Di Pierro
I do not know how long web2py slices will live. Bruno does not want to maintain it and GoDaddy is adopting their usual policy of not allowing the domain transfer (they say yes but it does not work). We need a better solution. Would you opposed to a scripts/azure/ subfolder? On Thursday, 12

[web2py] Re: Scheduler - Worker node heartbeats stop randomly

2015-11-12 Thread Gary Cowell
I use supervisord because it brings the configuration of daemon services within a consistent configuration. I can write one supervisord.conf, and so long as the supervisor is installed in any given distro, I can run my services. No need to then worry about upstart vs systemd vs SysV init vs

[web2py] Re: scheduler problem: stressed worker stops working

2015-11-12 Thread Niphlod
scheduler is NOT meant for realtime operations (yep, I said it). You'd better off configuring a little script (bottle?!) ran with root and listening to another port. On Thursday, November 12, 2015 at 9:05:03 AM UTC+1, Manuele wrote: > > Hi! > I have developed a web application using web2py

[web2py] Re: Dynamic addition of name-value pairs using SQLFORM or CRUD

2015-11-12 Thread 黄祥
pardon me, not sure what do you mean with free-text field? is it same like cell phone type of field (list:string) e.g. db.define_table('config', Field('cell_phones', 'list:string', label=T('Dispatchers Cell Phone #s') ), Field('service_provider_name', 'list:string', label=T('Service

[web2py] Re: Dynamic addition of name-value pairs using SQLFORM or CRUD

2015-11-12 Thread at
Initially I was thinking the same, but results are not as desired: db.define_table('phone', Field('service_type', 'string'), Field('phone_number', 'string')) db.define_table('config2', Field('cell_phones', 'list:reference phone'), label=T('Dispatchers Cell Phone #s')) Thanks, AT

[web2py] Re: Dynamic addition of name-value pairs using SQLFORM or CRUD

2015-11-12 Thread 黄祥
sorry, perhaps you can use list:reference type of field for that. - create table that store cell phone number and it's service type - then define config table that have list:reference to the table that store cell phone number and service type. - another thing is if you want to add new cell phone

[web2py] SQLFORM.grid export and user_signature issue

2015-11-12 Thread Carlos Kitu
There seems to be an issue with export (any class of export: csv, tsv, ...) in SQLFORM.grid when using user_signature and the corresponding decorator. Pressing any export button in that context generates a: Not authorized. Insufficient privileges - Error Here is a minimal example of the code:

[web2py] Re: Dynamic addition of name-value pairs using SQLFORM or CRUD

2015-11-12 Thread at
Hi Stifan, Thank you for your prompt reply. This will not give the desired result. After your suggested change, I get: What I need is service-type and phone-number side-by-side, so when I add a record it should add one service-name and one corresponding phone number. Best Regards, Atif On

[web2py] Re: db(db.x.id in [foo, man, chu]).select() does not work

2015-11-12 Thread Mark Billion
Works like a charm. Thanks On Thursday, November 12, 2015 at 11:46:33 AM UTC-5, Anthony wrote: > > db.x.id.belongs([list, of, ids]) > > > > On Thursday, November 12, 2015 at 11:35:48 AM UTC-5, Mark Billion wrote: >> >> I want to select all database rows with ids in a preset list ... contains >>

[web2py] securing download function

2015-11-12 Thread Mark Billion
Im not sure if this is necessary/redundant, but here is my question: Is there any way to check permission for the download -- i.e., the client associated with the file is checked and confirmed prior to the initiation of the dl without having to pass extra vars -- i.e., just using the filename

Re: [web2py] Re: web2py flash using bootstrap3 alerts and flash status is way to bothersome to implement

2015-11-12 Thread Richard Vézina
Thanks for "$.web2py.flash()" Leonel... I needed just that... :) I think this is something missing in the book search with "$.web2py.flash" in the book return nothing. Thank you... Richard On Fri, Jun 27, 2014 at 4:11 PM, Niphlod wrote: > unfortunately, the main point is

[web2py] Dynamic addition of name-value pairs using SQLFORM or CRUD

2015-11-12 Thread at
Hi, Following is a simple form where users can enter their phone numbers. A user can enter as many numbers as he wants. How can I make it to take

[web2py] db(db.x.id in [foo, man, chu]).select() does not work

2015-11-12 Thread Mark Billion
I want to select all database rows with ids in a preset list ... contains grabs everything that is like the list entry -- i.e. .contains(1) will snag records 1, 12, etc. And 'in' obviously doesnt work. Thoughts? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: db(db.x.id in [foo, man, chu]).select() does not work

2015-11-12 Thread Anthony
db.x.id.belongs([list, of, ids]) On Thursday, November 12, 2015 at 11:35:48 AM UTC-5, Mark Billion wrote: > > I want to select all database rows with ids in a preset list ... contains > grabs everything that is like the list entry -- i.e. .contains(1) will snag > records 1, 12, etc. And 'in'

[web2py] Re: DAL returns string fields not as unicode strings

2015-11-12 Thread Dandelion Mine
I tried it on 2.12.3-stable: >>> db = DAL('sqlite://storage.sqlite') >>> db._db_codec 'UTF-8' >>> db.define_table('unicode_test', Field('test', 'string')) >>> test_val = unicode('på Facebook', 'utf-8') >>> db.unicode_test.insert(test=test_val) 1L >>> for r in db(db.unicode_test).select(): print

[web2py] Indexes

2015-11-12 Thread Fabiano Almeida
Hi All! In book I see example how to create index with executesql . How to use indexes in querys? Thx, Fabiano. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] Re: web2py and python3

2015-11-12 Thread Massimo Di Pierro
I do not think it is a secret. As far as I know the security pricing infrastructure of Bank of America is based on proprietary object database built in Python and the JP Morgan Chase has been working for some time on an internal trading platform based on Python (do not know if it is in use at