[web2py] Re: Form + combined

2014-04-19 Thread Lucas Schreiber
Uhm, while working, i noticed your code does not really have all features i tried to implent, i'm sorry. Am Donnerstag, 17. April 2014 15:35:11 UTC+2 schrieb Lucas Schreiber: > hey, > i have a Problem and i don't know how to solve it. I want a form with an > Input "text" field ( let's call it

Re: [web2py] SQLFORM inserts new record instead of updating existing record

2014-04-19 Thread Khalil KHAMLICHI
maybe something like this would work : if idToEdit : record = db(db.langResource.id==idToEdit) sqlForm = SQLFORM(db.langResource, record)# update existing else : sqlForm = SQLFORM(db.langResource) # create new if sqlForm.process().accepted: respons

[web2py] Re: how to cleanse field value

2014-04-19 Thread Joe Barnhart
The "None" placeholder is for a custom error message. I always look to the source code when I have questions like this (which is a frequent occurrence for me). Here is a sample from the source: class IS_EQUAL_TO(Validator): """ example:: INPUT(_type='text', _name='password')

Re: [web2py] SQLFORM inserts new record instead of updating existing record

2014-04-19 Thread Khalil KHAMLICHI
oops I forgot to add the "hidden=dict(idToEdit=idToEdit) " code edited below : if idToEdit : record = db(db.langResource.id==idToEdit) sqlForm = SQLFORM(db.langResource, record, hidden=dict(idToEdit=idToEdit))# update existing else : sqlForm = SQLFORM(db.langResourc

[web2py] How to output data from sqlite3 table to html

2014-04-19 Thread Maurice Waka
I am trying to use web2py to build an app. I have a simple print function that a user submits a key word . The string or int key word is directed to an sqlite db to retrieve a row and output the data. I need to know 1. how to use the print on html. 2. How to split the string...so far i did the

[web2py] synchronizing a sharing a variable between instances of an application

2014-04-19 Thread scruffyexaminer
My app uses a data service that requires periodically requesting an access_token using my apps credentials given by the data service provider. I send this token in the header of every request my app sends to the data service, and I only know the token has expired when a request comes back with

[web2py] How do I retrieve Row by id from a join query result object

2014-04-19 Thread Kurt Jensen
How can I get a row from a DAL object if I know the associated id. Example: my_phones=db((db.prof_phone.pid==person_id)&(db.prof_phone.provider>1)). select(db.prof_phone.ALL,db.provider.edomain, left=db.provider.on(db.provider.id==db.prof_phone.provider),orderby= db.prof_phone.label) Whic

[web2py] Get data associated with known id from DAL object

2014-04-19 Thread Kurt Jensen
I have a left join query: phones=db((db.prof_phone.pid==person_id)&(db.prof_phone.provider>1)).select(db.prof_phone.ALL,db.provider.edomain, left=db.provider.on(db.provider.id==db.prof_phone.provider),orderby=db.prof_phone.label) which gives me an object: phones:prof_phone.id prof_ph

[web2py] Need to access SQLite3 database file but have no definitions for tables

2014-04-19 Thread Spencer Underwood
I'm pretty new to web development as a whole and am planning to make a website for people playing the game EVE Online to use but have encountered some difficulty trying to access the database dump that CCP Games has released. The database dump is available here

[web2py] Re: SQLFORM inserts new record instead of updating existing record

2014-04-19 Thread Anthony
You should not call form.process twice. Does idToEdit come from a URL arg or var? Maybe something like this: def myform(): record = db.langResource(request.args(0)) form = SQLFORM(db.langResource, record=record).process( message_onsuccess='Resource modified' if record else 'New re

[web2py] Re: How do I retrieve Row by id from a join query result object

2014-04-19 Thread Anthony
row = my_phones.find(lambda r: r.id == 3)[0] Note, .find() is a Python function, so this will indeed iterate over the rows of my_phones. If my_phones is large, it may actually be more efficient to simply issue a separate query to the database to retrieve that one record. Anthony On Saturday,

[web2py] Re: synchronizing a sharing a variable between instances of an application

2014-04-19 Thread Anthony
Quick clarification -- by "every instance of my app", do you simply mean each separate request that comes into the app, or do you have different instances of the app running on different servers? On Saturday, April 19, 2014 10:48:11 AM UTC-4, scruffy...@gmail.com wrote: > > My app uses a data se

[web2py] Re: How to output data from sqlite3 table to html

2014-04-19 Thread Massimo Di Pierro
You can split a string with name.split() and you can print in HTML with {{=a}} where a is a string or other serializable type. We can help you much more if you tell us the names and types of the fields in your table. You app is going to be very slow because you open the database at every request

Re: [web2py] Get data associated with known id from DAL object

2014-04-19 Thread Roberto Perdomo
Simply: phones[1].prof_phone.phone and phones[1].provider.edomain if we supouse that the id 3 is the second result in the row (1 is the index of the phones rows). If you don't know the position in the result, but know the id of the row: for phone in phones: if phone.prof_phone.id == 2: print 'Pho

[web2py] alternate date and time picker

2014-04-19 Thread Greg Vaughan
Is there any way that I can use a different date and time picker. The default one is horrible but it seems to be "baked in" to web2py? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/iss

[web2py] Re: alternate date and time picker

2014-04-19 Thread Annet
Hi Greg, Is there any way that I can use a different date and time picker. The > default one is horrible but it seems to be "baked in" to web2py? > I use a customized version of jQuery UI (I only needed the datepicker and autocomplete). You can extend the datepicker with this timepicker: http:/