[web2py] DAL size limit for query?
Hello is there any size limit in DAL about query? i explain: i have a script that stop running. I thought it was a problem with modwsgi becouse i got the error message 'truncatet or oversize respoinse header' (so that i post this question : https://groups.google.com/forum/#!topic/web2py/CRsEWe_mmSc) but now i realized the problem raise even in the web2py shell, exactly when querying: This is from my pc: """ tabella = 'STK' In [3]: query = legacy_db[tabella] legacy_db(query).select() Out[5]: "" this from the server, where the data in the db is are more: """In [1]: tabella = 'STK' In [2]: query =legacy_db[tabella] In [4]: legacy_db(query).select() Killed root@rb:/home/www-data/web2py# """ i still can query through 'executesql' : n [1]: rows = legacy_db.executesql("select * from STK") In [2]: len(rows) Out[2]: 155370 The insertion in the table, by means of DAL and a cronjob, still is working Any help? Thanks -- 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] Truncated or oversized response headers [ot?]
hello i have a problem when creating a csv from a db. i got "Truncated or oversized response headers received from daemon process 'web2py': /home/www-data/web2py/wsgihandler.py" searching google i found the solution should be setting the 'header-buffer-size' option for WSGI daemon. But i cannot find how to do this Anyone can help? -- 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] many tyo many
Hello i have a table 'post' and a table 'tag' and as there is a 'many to many' relationship between them, i also created a table 'post_tag' that only has reference to previous tables. But now, in the form to create post (form = SQLFORM(db.post)) how can i add field to select/create tags? Is there any shortcut ora i have to build the form manually? Thanks -- 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] rediretct 2 https [ ubuntu.sh]
Hello i see that the script that install web2py (ubuntu.sh) by defualt will force every request to https. Why? Is there any problem to remove the redirect? Thanks -- 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_record TypeError
sorry i forgot the ** previous_cruscu.update_record(**query) i beg pardon to all the users' list, dark night working obfuscated me Il giorno domenica 21 febbraio 2016 23:55:43 UTC+1, goome ha scritto: > > hello > i need to update a record (by mean of an update_or_insert or by > update_record). > But the statement with the new values is built programaticaly in 2 step. > So i fist create a dict with nuewvalues=dict(field1=value1,field2=value2) > then i eventually add some value with newvalues['otherfield']=value3, ect > but i got error: > Traceback (most recent call last): > File "/home/www-data/web2py/gluon/shell.py", line 263, in run > execfile(startfile, _env) > File "applications/PROVE/private/automazione.py", line 225, in > ret = previous_cruscu.update_record(query) > TypeError: __call__() takes exactly 1 argument (2 given) > > i should i build the dictionary of new vales? > -- 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_record TypeError
hello i need to update a record (by mean of an update_or_insert or by update_record). But the statement with the new values is built programaticaly in 2 step. So i fist create a dict with nuewvalues=dict(field1=value1,field2=value2) then i eventually add some value with newvalues['otherfield']=value3, ect but i got error: Traceback (most recent call last): File "/home/www-data/web2py/gluon/shell.py", line 263, in run execfile(startfile, _env) File "applications/PROVE/private/automazione.py", line 225, in ret = previous_cruscu.update_record(query) TypeError: __call__() takes exactly 1 argument (2 given) i should i build the dictionary of new vales? -- 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: DAL : deltatime field ?
thanks to all! -- 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: DAL : deltatime field ?
thanks! -- 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] DAL : deltatime field ?
hi If i am correct there is no deltatime field in DAL, i mean a field where to store difference from 2 datetime object. So which is the suggested solution in this case? just a string field? Thanks -- 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: pygal and SQL.form
tried with return dict(form=form,chart=chart) ? Il giorno mercoledì 20 gennaio 2016 14:47:16 UTC+1, kecajk...@gmail.com ha scritto: > > Hi Guys, > > I try to use pygal to draw some charts and it works fine. I used example > from: > > > http://www.web2pyslices.com/slice/show/1634/beauty-graphics-and-charts-with-pygal > > However i don't know how to display SQL.form and pygal chart in one view. > > My code > > > def form_and_chart(): > chart = plot_pygal() > form = SQLFORM.factory( Field('time') ) > return dict(form=form),chart > > > def plot_pygal(): > response.headers['Content-Type']='image/svg+xml' > bar_chart = pygal.Bar(style=CleanStyle) # Then create a bar graph object > bar_chart.add('Fibonacci', [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]) # Add > some values > return bar_chart.render() > > > view: form_and_chart.html > > {{extend 'layout.html'}} > {{=form}} > http://localhost/myapp/default/plot_pygal.svg"; type= > "image/svg+xml" /> > > > When i do return(form=form), form is displayed correctly, when i do return > chart, chart is displayed correctly. How to combine those two to be > displayed on one page? > > Thanks! > -- 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] view
Does view truncate datas ? I have this in controller: [...] form = legacy_db(query).select() return dict (form = form) and the classic view: {{ extend 'layout.html' }} {{=form}} executing the funcition from the shell, i see the data correct(i mean the hole data) for example >>> form[0]['paid_at'] '2016-01-09 18:33:37 +0100' but in the browseri can see only: 2016-01-09 18... this is the first time i realized this behaviour. Is this normal? how can i get the whole data? Thanks -- 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: request.args
ah ok, tanks a lot Il giorno lunedì 18 gennaio 2016 14:18:49 UTC+1, Anthony ha scritto: > > On Monday, January 18, 2016 at 4:29:56 AM UTC-5, goome wrote: >> >> Thank you! >> It works, but i cannot understnd how and why. >> Could you explain? >> How is grid interested in request.args(if i don't use it as such, but >> copy args[0] in ufie and pass that to grid)? >> > > The grid creates a number of links, such as those for creating, viewing, > and editing records -- each of those links must point back to the action > that created the grid, so the grid adds URL args to further specify the > particular function requested. If the base URL already includes some > additional URL args used for other purposes, you must tell the grid so it > will ignore those args and append its own args to those in the base URL. > > 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: request.args
Thank you! It works, but i cannot understnd how and why. Could you explain? How is grid interested in request.args(if i don't use it as such, but copy args[0] in ufie and pass that to grid)? Il giorno lunedì 18 gennaio 2016 02:10:32 UTC+1, Massimo Di Pierro ha scritto: > > should eb > > def vistaSIMFDB(): > ufile=request.args(0) > > #ufile='SIMFDB_2016011509341800.csv' > #form=legacy_db(legacy_db.SIMFDB.filename==ufile).select() > form = SQLFORM.grid(legacy_db.SIMFDB.filename==ufile, csv=True, > args=request.args[:1] ) > return dict(form=form) > > > you have to tell the grid which args to exclude. > > On Sunday, 17 January 2016 14:25:49 UTC-6, goome wrote: >> >> this is making me mad(i think i am missing somethng obvious, bt i don't >> know what): >> This work: >> def vistaSIMFDB(): >> ufile=request.args[0] >> #ufile='SIMFDB_2016011509341800.csv' >> form=legacy_db(legacy_db.SIMFDB.filename==ufile).select() >> #form = SQLFORM.grid(legacy_db.SIMFDB.filename==ufile, csv=True ) >> return dict(form=form) >> >> >> This , which use SQLFORM.grid, but no request.args, also work: >> def vistaSIMFDB(): >> #ufile=request.args[0] >> ufile='SIMFDB_2016011509341800.csv' >> #form=legacy_db(legacy_db.SIMFDB.filename==ufile).select() >> form = SQLFORM.grid(legacy_db.SIMFDB.filename==ufile, csv=True ) >> return dict(form=form) >> >> >> This (sqlform.grid with a parameter got from request.args) not: >> i am redirect to >> http://127.0.0.1:8000/PROVE/vistaSIMFDB?_signature=c3d5a81a14fa239430285e2444c0f0fb568aba2d >> : >> >> Ticket ID >> >> 127.0.0.1.2016-01-17.21-21-32.80e5e27e-d857-4431-9876-a44d3c169182 >> list index out of range Version web2py™ >> Version >> 2.10.4-stable+timestamp.2015.04.26.15.11.54 Python Python 2.7.6: >> /usr/bin/python (prefix: /usr) Traceback >> >> 1. >> 2. >> 3. >> 4. >> 5. >> 6. >> 7. >> 8. >> 9. >> 10. >> >> Traceback (most recent call last): >> File "/home/marcello/CODE/MIEI/WEB2.10/gluon/restricted.py", line 227, in >> restricted >> exec ccode in environment >> File >> "/home/marcello/CODE/MIEI/WEB2.10/applications/PROVE/controllers/default.py" >> <http://127.0.0.1:8000/admin/edit/PROVE/controllers/default.py>, line 1559, >> in >> File "/home/marcello/CODE/MIEI/WEB2.10/gluon/globals.py", line 393, in >> >> self._caller = lambda f: f() >> File >> "/home/marcello/CODE/MIEI/WEB2.10/applications/PROVE/controllers/default.py" >> <http://127.0.0.1:8000/admin/edit/PROVE/controllers/default.py>, line 1522, >> in vistaSIMFDB >> ufile=request.args[0] >> IndexError: list index out of range >> >> Error snapshot [image: help] >> <http://127.0.0.1:8000/admin/default/ticket/PROVE/127.0.0.1.2016-01-17.21-21-32.80e5e27e-d857-4431-9876-a44d3c169182#> >> >> >> (list index out of range) >> >> inspect attributes >> Frames >> >>- >> >>*File /home/marcello/CODE/MIEI/WEB2.10/gluon/restricted.py in >>restricted at line 227* code arguments variables >>- >> >>*File >> >> /home/marcello/CODE/MIEI/WEB2.10/applications/PROVE/controllers/default.py >>in at line 1559* code arguments variables >>- >> >>*File /home/marcello/CODE/MIEI/WEB2.10/gluon/globals.py in >>at line 393* code arguments variables >>- >> >>*File >> >> /home/marcello/CODE/MIEI/WEB2.10/applications/PROVE/controllers/default.py >>in vistaSIMFDB at line 1522* code arguments variables >>Function argument list >> >>() >>Code listing >> >>1517. >>1518. >>1519. >>1520. >>1521. >>1522. >> >>1523. >>1524. >>1525. >>1526. >> >>form=legacy_db(legacy_db.STK.filename==ufile).select() >> return dict(form=form) >> >> >>def vistaSIMFDB(): >> ufile=request.args[0] >> >> #ufile='SIMFDB_2016011509341800.csv' >> #form=legacy_db(legacy_db.SIMFDB.filename==ufile).select() >> form = SQLFORM.grid(legacy_db.SIMFDB.filename==ufile, csv=True ) >> return dict(form=form) >> >>Variables global request >'vistaS
[web2py] Re: request.args
this is making me mad(i think i am missing somethng obvious, bt i don't know what): This work: def vistaSIMFDB(): ufile=request.args[0] #ufile='SIMFDB_2016011509341800.csv' form=legacy_db(legacy_db.SIMFDB.filename==ufile).select() #form = SQLFORM.grid(legacy_db.SIMFDB.filename==ufile, csv=True ) return dict(form=form) This , which use SQLFORM.grid, but no request.args, also work: def vistaSIMFDB(): #ufile=request.args[0] ufile='SIMFDB_2016011509341800.csv' #form=legacy_db(legacy_db.SIMFDB.filename==ufile).select() form = SQLFORM.grid(legacy_db.SIMFDB.filename==ufile, csv=True ) return dict(form=form) This (sqlform.grid with a parameter got from request.args) not: i am redirect to http://127.0.0.1:8000/PROVE/vistaSIMFDB?_signature=c3d5a81a14fa239430285e2444c0f0fb568aba2d : Ticket ID 127.0.0.1.2016-01-17.21-21-32.80e5e27e-d857-4431-9876-a44d3c169182 list index out of range Version web2py™ Version 2.10.4-stable+timestamp.2015.04.26.15.11.54 Python Python 2.7.6: /usr/bin/python (prefix: /usr) Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Traceback (most recent call last): File "/home/marcello/CODE/MIEI/WEB2.10/gluon/restricted.py", line 227, in restricted exec ccode in environment File "/home/marcello/CODE/MIEI/WEB2.10/applications/PROVE/controllers/default.py" <http://127.0.0.1:8000/admin/edit/PROVE/controllers/default.py>, line 1559, in File "/home/marcello/CODE/MIEI/WEB2.10/gluon/globals.py", line 393, in self._caller = lambda f: f() File "/home/marcello/CODE/MIEI/WEB2.10/applications/PROVE/controllers/default.py" <http://127.0.0.1:8000/admin/edit/PROVE/controllers/default.py>, line 1522, in vistaSIMFDB ufile=request.args[0] IndexError: list index out of range Error snapshot [image: help] <http://127.0.0.1:8000/admin/default/ticket/PROVE/127.0.0.1.2016-01-17.21-21-32.80e5e27e-d857-4431-9876-a44d3c169182#> (list index out of range) inspect attributes Frames - *File /home/marcello/CODE/MIEI/WEB2.10/gluon/restricted.py in restricted at line 227* code arguments variables - *File /home/marcello/CODE/MIEI/WEB2.10/applications/PROVE/controllers/default.py in at line 1559* code arguments variables - *File /home/marcello/CODE/MIEI/WEB2.10/gluon/globals.py in at line 393* code arguments variables - *File /home/marcello/CODE/MIEI/WEB2.10/applications/PROVE/controllers/default.py in vistaSIMFDB at line 1522* code arguments variables Function argument list () Code listing 1517. 1518. 1519. 1520. 1521. 1522. 1523. 1524. 1525. 1526. form=legacy_db(legacy_db.STK.filename==ufile).select() return dict(form=form) def vistaSIMFDB(): ufile=request.args[0] #ufile='SIMFDB_2016011509341800.csv' #form=legacy_db(legacy_db.SIMFDB.filename==ufile).select() form = SQLFORM.grid(legacy_db.SIMFDB.filename==ufile, csv=True ) return dict(form=form) Variables global request request.args [] ufile undefined so that the problem seems to be with grid and request.args togheter, which seems quite bizarre, also becouse the ticket point to fails in request.args, while grid is called after Il giorno domenica 17 gennaio 2016 19:49:37 UTC+1, Anthony ha scritto: > > Is that all you have in routes, because your URL excludes the controller, > which would also be implemented via the routes? > > Also, when you get that error, is the exact URL in the address bar of the > browser > http://127.0.0.1:8000/PROVE/dettaglio_aggiornamenti/SPE/SPE_2016011518051300.csv > > <http://www.google.com/url?q=http%3A%2F%2F127.0.0.1%3A8000%2FPROVE%2Fdettaglio_aggiornamenti%2FSPE%2FSPE_2016011518051300.csv&sa=D&sntz=1&usg=AFQjCNFhQTgpGs53IZXyE2EC-KQWNkEvuw> > ? > > On Sunday, January 17, 2016 at 11:24:04 AM UTC-5, goome wrote: >> >> i have route_in that about this app has : >> ('/PROVE','/PROVE/default/index') >> >> Il giorno domenica 17 gennaio 2016 14:06:51 UTC+1, Niphlod ha scritto: >>> >>> are you using routes.py ? >>> >>> On Sunday, January 17, 2016 at 11:12:16 AM UTC+1, goome wrote: >>>> >>>> i have this url : >>>> http://127.0.0.1:8000/PROVE/dettaglio_aggiornamenti/SPE/SPE_2016011518051300.csv >>>> >>>> <http://www.google.com/url?q=http%3A%2F%2F127.0.0.1%3A8000%2FPROVE%2Fdettaglio_aggiornamenti%2FSPE%2FSPE_2016011518051300.csv&sa=D&sntz=1&usg=AFQjCNFhQTgpGs53IZXyE2EC-KQWNkEvuw> >>>> >>>> generated by: >>>> >>>> href="{{=URL(r=request,f='dettaglio_aggiornamenti',args=['SPE',ultimoFileSpe])}} >>>
[web2py] Re: request.args
i have route_in that about this app has : ('/PROVE','/PROVE/default/index') Il giorno domenica 17 gennaio 2016 14:06:51 UTC+1, Niphlod ha scritto: > > are you using routes.py ? > > On Sunday, January 17, 2016 at 11:12:16 AM UTC+1, goome wrote: >> >> i have this url : >> http://127.0.0.1:8000/PROVE/dettaglio_aggiornamenti/SPE/SPE_2016011518051300.csv >> >> generated by: >> >> href="{{=URL(r=request,f='dettaglio_aggiornamenti',args=['SPE',ultimoFileSpe])}} >> i believed that >> request.args[0] == 'SPE' >> and >> request.args[1]== 'SPE_2016011518051300.csv' >> >> but i got : >> """ >> list index out of range >> >> >> Function argument list >> >> () >> Code listing >> >> 1520. >> 1521. >> 1522. >> 1523. >> 1524. >> 1525. >> >> 1526. >> 1527. >> 1528. >> 1529. >> >> records=legacy_db(legacy_db.SFIMDB.filename==ufile).select() >> return dict(records=records) >> >> >> def dettaglio_aggiornamenti(): >> tab = request.args[0] >> >> b=request.args[1] >> >> >> >> Variables global request > 'dettaglio_...marcello/CODE/MIEI/WEB2.10/applications/PROVE/'}> >> request.args [] tab undefined >> >> >> """ >> >> Why request.args turns to be undefined >> >> -- 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] request.args
i have this url : http://127.0.0.1:8000/PROVE/dettaglio_aggiornamenti/SPE/SPE_2016011518051300.csv generated by: href="{{=URL(r=request,f='dettaglio_aggiornamenti',args=['SPE',ultimoFileSpe])}} i believed that request.args[0] == 'SPE' and request.args[1]== 'SPE_2016011518051300.csv' but i got : """ list index out of range Function argument list () Code listing 1520. 1521. 1522. 1523. 1524. 1525. 1526. 1527. 1528. 1529. records=legacy_db(legacy_db.SFIMDB.filename==ufile).select() return dict(records=records) def dettaglio_aggiornamenti(): tab = request.args[0] b=request.args[1] Variables global request request.args [] tab undefined """ Why request.args turns to be undefined -- 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: import_from_csv_file: how to map columns
Thanks for your help! Il giorno mercoledì 13 gennaio 2016 16:38:12 UTC+1, Anthony ha scritto: > > I think you'll have to manually change the column names in the file, > either by hand or via Python code. > > Anthony > > On Wednesday, January 13, 2016 at 7:33:20 AM UTC-5, goome wrote: >> >> Hi >> i created i table definition in db.py by using csvstudio.py, but i cannot >> load the values through db.table.import_from_csv_file becouse the header in >> the csv have spaces and uppercases. >> So there a way to tell import_from_csv_file how to map column in csv with >> that in table definition? >> By the way, column in csv are in the same order than in table definition. >> Thanks >> > -- 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] import_from_csv_file: how to map columns
Hi i created i table definition in db.py by using csvstudio.py, but i cannot load the values through db.table.import_from_csv_file becouse the header in the csv have spaces and uppercases. So there a way to tell import_from_csv_file how to map column in csv with that in table definition? By the way, column in csv are in the same order than in table definition. Thanks -- 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] import_from_csv_file
hi Does import_from_csv_file only operate insert sql statement or it could also operate update record? In this case would it be enough the presence of unique column in the csv(without id) for it? Thanks -- 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: empy string from csv for integer for integer field
> Or changing the validator to provide the NULL. how could it be done? in the model? Thanks > > > -- 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] empy string from csv for integer for integer field
Hello i have a table with integer field. i populated thhe db from a csv (created from other then me). it sometimes has empty value for the integers fields. So when i try to get a list of the records of the table, i got: type 'exceptions.ValueError'> invalid literal for long() with base 10: '' from db.py #table prodotti Field("lunghezza","integer"), Field("larghezza","integer"), from default.py prodotti = legacy_db().select(legacy_db.prodotti.ALL,orderby='prodotti.id DESC', limitby=limitby) The error ticket: File "/home/marcello/scripts/web2py/2/web2py/applications/PROVE/controllers/default.py", line 171, in lista_prodotti prodotti = legacy_db().select(legacy_db.prodotti.ALL,orderby='prodotti.id DESC', limitby=limitby) File "/home/marcello/scripts/web2py/2/web2py/gluon/packages/dal/pydal/objects.py", line 2026, in select return adapter.select(self.query,fields,attributes) File "/home/marcello/scripts/web2py/2/web2py/gluon/packages/dal/pydal/adapters/sqlite.py", line 125, in select return super(SQLiteAdapter, self).select(query, fields, attributes) File "/home/marcello/scripts/web2py/2/web2py/gluon/packages/dal/pydal/adapters/base.py", line 1239, in select return self._select_aux(sql,fields,attributes) File "/home/marcello/scripts/web2py/2/web2py/gluon/packages/dal/pydal/adapters/base.py", line 1220, in _select_aux return processor(rows,fields,self._colnames,cacheable=cacheable) File "/home/marcello/scripts/web2py/2/web2py/gluon/packages/dal/pydal/adapters/base.py", line 1596, in parse value = self.parse_value(value,ft,blob_decode) File "/home/marcello/scripts/web2py/2/web2py/gluon/packages/dal/pydal/adapters/base.py", line 1450, in parse_value return self.parsemap[key](value,field_type) File "/home/marcello/scripts/web2py/2/web2py/gluon/packages/dal/pydal/adapters/base.py", line 1534, in parse_integer return long(value) ValueError: invalid literal for long() with base 10: '' how to face with empty values? -- 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: compute field with function NOT lambda
that worked, thanks -- 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: compute field with function NOT lambda
Il giorno venerdì 29 maggio 2015 23:33:50 UTC+2, Anthony ha scritto: > > "writable", not "readable". > Thank for you help Anthony. I don't want the user should fill the field in the form, as ùits values is computed, i just want they see the computed value. In any case, even putting legacy_db.ordinipo.total.writable=True the field is not shown in the sqlform generated form 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 model (db.py). > Should i put it ont the form too? In this case, how? > Thanks > -- 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: compute field with function NOT lambda
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.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: compute field with function NOT lambda
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 maggio 2015 18:33:10 UTC+2, goome ha scritto: > > 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'] * r['quantidade']) > But i need more process before > So ewhat should be the syntax? > def fun(r): > process() > r['preco'] * r['quantidade']) > > Thanks > -- 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] compute field with function NOT lambda
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'] * r['quantidade']) But i need more process before So ewhat should be the syntax? def fun(r): process() r['preco'] * r['quantidade']) Thanks -- 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] modifing model has no effect
Thank you for your atention Richard. Initially there was no migrate setting for the table, then realizing not working i tried to set explicitly migrate=True and then fake_migrate=True. However i don't think is there the problem, due to the fact that web2py has indeed created the column in the db, as recorded in sql.log ("ALTER TABLE ordinipo ADD confermato_il TIMESTAMP"), but the column in not view from web2py itself Thanks Il giorno lunedì 25 maggio 2015 18:22:30 UTC+2, Richard ha scritto: > > What the state of your migrate flag? True or False? > > Notice there is also a migrate_all or something at the DB string level > which prevent migrating of every tables... > > Richard > > On Mon, May 25, 2015 at 11:48 AM, goome > > wrote: > >> Hello >> i again here to beg your help. >> I modified a table (adding a column and setting writable=False in >> another) in modes/db.py >> but it had no effect: nor a form created by SQLFORM reflect the changes, >> nor >> db.table.fields show the new column. >> But the column has indeed created in the db (sqlite). I can see it >> querying the db directly, and also insql.log i can see the modification. >> Moreover i make the same modification in the remote production server, >> and there it worked. >> What can be the problem in the local server? >> Thanks >> >> -- >> 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+un...@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] modifing model has no effect
Hello i again here to beg your help. I modified a table (adding a column and setting writable=False in another) in modes/db.py but it had no effect: nor a form created by SQLFORM reflect the changes, nor db.table.fields show the new column. But the column has indeed created in the db (sqlite). I can see it querying the db directly, and also insql.log i can see the modification. Moreover i make the same modification in the remote production server, and there it worked. What can be the problem in the local server? Thanks -- 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: migration type mismatch
Thank you very much for your help. Sadly, it did not work. Il giorno giovedì 21 maggio 2015 20:16:01 UTC+2, Anthony ha scritto: > > You didn't turn off migrations in the new app, so web2py thinks it needs > to create the table. If you want the new app to control the migrations, > you'll have to run one fake migrate so the new app will have a record of > the current state of the database. > > 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] migration type mismatch
from the book :"define_table checks whether or not the corresponding table exists. If it does not, it generates the SQL to create it and executes the SQL. If the table does exist but differs from the one being defined, it generates the SQL to alter the table and executes it. If a field has changed type but not name, it will try to convert the data" So i suppose that this could help me in cleaning data (from type mismatch). i copied the current project(application) in a new one, leaving in the dir 'databases' only the sqlite storage. But when i open the home page od this copied app, i got 'table already exists'. In models/db.py there are no migrate setting , except for auth table, where i set it to migrate=False, as this seems necessary. Why web2py does not alter(if needed) the table, and instead complains of already existing one? -- 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] db.export_to_csv_file and type mismatch
hello there is some way to export all the data (that have some type mismatch from modles/db definitions and real values present) and then reload cleaned? i tried with db.export_to_csv_file but give me error : ValueError: invalid literal for long() in fact, there are alues that should be double (o decimal) and that instedad are string (ex.: '27.0' for 27.0) This cause runtime error Any 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 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] AttributeError: 'Query' object has no attribute 'type'
Hello i am trying to translate this piece of code in web2py dialect: cur.execute("select * from prodotti where SupplierID=?",[fornitore]) (this give me correct results) i tried with prodotti = legacy_db().select(legacy_db.prodotti.SupplierID==fornitore) but i got error: AttributeError: 'Query' object has no attribute 'type' Then i tried with: prodotti = legacy_db(legacy_db.prodotti.SupplierID==fornitore).select( ) and this worked. My questio is : why the first form does not work? Shuoldn't they be equivalent? how should i translate the where condition in the select part? Thanks -- 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: AttributeError: 'DAL' object has no attribute
Yes the table is defined and can see the list of 'prodotti' thrugh web access. Thanks for your help Il giorno giovedì 14 maggio 2015 10:25:25 UTC+2, Paolo Valleri ha scritto: > > have you defined the table? > web2py 2.4.* is really old. I suggest upgrading to a newer version > > Paolo > > 2015-05-14 10:16 GMT+02:00 goome >: > >> from the shell i tried >> >> legacy_db = DAL('sqlite://rocketdb') >> # it found the db >> fornitori = >> legacy_db().select(legacy_db.fornitori.ALL,orderby=legacy_db.fornitori.BrandName.upper()) >> >> stille give error >> AttributeError: 'DAL' object has no attribute 'fornitori' >> >> but now this is working calles from the server >> ?? >> >> >> Il giorno giovedì 14 maggio 2015 09:38:33 UTC+2, goome ha scritto: >>> >>> 2.4.6 stable >>> No, i cannot reproduce because today when i open the browser it worked! >>> By the way, what is the correct way load the models in the shell? >>> i open the shell with >>> python web2py -S myapplic >>> lanched from the dir of web2py, so that myapplic in under appilcations/ >>> >>> >>> >>> Il giorno mercoledì 13 maggio 2015 21:14:27 UTC+2, Paolo Valleri ha >>> scritto: >>>> >>>> Which web2py version are you using? >>>> Can you post a complete example that reproduces the issue? >>>> >>>> Paolo >>>> >>>> On Wednesday, May 13, 2015 at 7:14:30 PM UTC+2, goome wrote: >>>>> >>>>> hello , i have this action in defaul.py >>>>> """ >>>>> @auth.requires_login() >>>>> def lista_fornitori(): >>>>> fornitori = >>>>> legacy_db().select(legacy_db.fornitori.ALL,orderby=legacy_db.fornitori.BrandName.upper()) >>>>> return dict(fornitori = fornitori) >>>>> "" >>>>> and this work perfectly giving me the list of records in table >>>>> 'fornitori' >>>>> >>>>> Now in another action i need to retrieve the same list for creating a >>>>> select, >>>>> but this time the same code >>>>> fornitori = legacy_db().select(legacy_db.fornitori.ALL) >>>>> fails with error >>>>> AttributeError: 'DAL' object has no attribute 'fornitori' >>>>> >>>>> why in this action DAL does not find the table fornitori? What could >>>>> be the problem. >>>>> The 2 actions are both in default.py >>>>> >>>>> The beginning of thje second actions: >>>>> def sel_fornitore(): >>>>> fornitori = legacy_db(legacy_db.fornitori.ALL).select() >>>>> >>>>> i also tried from shell with the same error. >>>>> What i am missing? >>>>> >>>>> -- >> 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 a topic in the >> Google Groups "web2py-users" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/web2py/B-Nqj2CKS-0/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> web2py+un...@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: AttributeError: 'DAL' object has no attribute
from the shell i tried legacy_db = DAL('sqlite://rocketdb') # it found the db fornitori = legacy_db().select(legacy_db.fornitori.ALL,orderby=legacy_db.fornitori.BrandName.upper()) stille give error AttributeError: 'DAL' object has no attribute 'fornitori' but now this is working calles from the server ?? Il giorno giovedì 14 maggio 2015 09:38:33 UTC+2, goome ha scritto: > > 2.4.6 stable > No, i cannot reproduce because today when i open the browser it worked! > By the way, what is the correct way load the models in the shell? > i open the shell with > python web2py -S myapplic > lanched from the dir of web2py, so that myapplic in under appilcations/ > > > > Il giorno mercoledì 13 maggio 2015 21:14:27 UTC+2, Paolo Valleri ha > scritto: >> >> Which web2py version are you using? >> Can you post a complete example that reproduces the issue? >> >> Paolo >> >> On Wednesday, May 13, 2015 at 7:14:30 PM UTC+2, goome wrote: >>> >>> hello , i have this action in defaul.py >>> """ >>> @auth.requires_login() >>> def lista_fornitori(): >>> fornitori = >>> legacy_db().select(legacy_db.fornitori.ALL,orderby=legacy_db.fornitori.BrandName.upper()) >>> return dict(fornitori = fornitori) >>> "" >>> and this work perfectly giving me the list of records in table >>> 'fornitori' >>> >>> Now in another action i need to retrieve the same list for creating a >>> select, >>> but this time the same code >>> fornitori = legacy_db().select(legacy_db.fornitori.ALL) >>> fails with error >>> AttributeError: 'DAL' object has no attribute 'fornitori' >>> >>> why in this action DAL does not find the table fornitori? What could be >>> the problem. >>> The 2 actions are both in default.py >>> >>> The beginning of thje second actions: >>> def sel_fornitore(): >>> fornitori = legacy_db(legacy_db.fornitori.ALL).select() >>> >>> i also tried from shell with the same error. >>> What i am missing? >>> >>> -- 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: AttributeError: 'DAL' object has no attribute
2.4.6 stable No, i cannot reproduce because today when i open the browser it worked! By the way, what is the correct way load the models in the shell? i open the shell with python web2py -S myapplic lanched from the dir of web2py, so that myapplic in under appilcations/ Il giorno mercoledì 13 maggio 2015 21:14:27 UTC+2, Paolo Valleri ha scritto: > > Which web2py version are you using? > Can you post a complete example that reproduces the issue? > > Paolo > > On Wednesday, May 13, 2015 at 7:14:30 PM UTC+2, goome wrote: >> >> hello , i have this action in defaul.py >> """ >> @auth.requires_login() >> def lista_fornitori(): >> fornitori = >> legacy_db().select(legacy_db.fornitori.ALL,orderby=legacy_db.fornitori.BrandName.upper()) >> return dict(fornitori = fornitori) >> "" >> and this work perfectly giving me the list of records in table 'fornitori' >> >> Now in another action i need to retrieve the same list for creating a >> select, >> but this time the same code >> fornitori = legacy_db().select(legacy_db.fornitori.ALL) >> fails with error >> AttributeError: 'DAL' object has no attribute 'fornitori' >> >> why in this action DAL does not find the table fornitori? What could be >> the problem. >> The 2 actions are both in default.py >> >> The beginning of thje second actions: >> def sel_fornitore(): >> fornitori = legacy_db(legacy_db.fornitori.ALL).select() >> >> i also tried from shell with the same error. >> What i am missing? >> >> -- 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] AttributeError: 'DAL' object has no attribute
hello , i have this action in defaul.py """ @auth.requires_login() def lista_fornitori(): fornitori = legacy_db().select(legacy_db.fornitori.ALL,orderby=legacy_db.fornitori.BrandName.upper()) return dict(fornitori = fornitori) "" and this work perfectly giving me the list of records in table 'fornitori' Now in another action i need to retrieve the same list for creating a select, but this time the same code fornitori = legacy_db().select(legacy_db.fornitori.ALL) fails with error AttributeError: 'DAL' object has no attribute 'fornitori' why in this action DAL does not find the table fornitori? What could be the problem. The 2 actions are both in default.py The beginning of thje second actions: def sel_fornitore(): fornitori = legacy_db(legacy_db.fornitori.ALL).select() i also tried from shell with the same error. What i am missing? -- 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] action about:blank
Hello i created a form(initially witj sqlform.factory, then by FORM() function, but the the form come up with action set to about:blank. I tried to explicitly set the action with _action='#'), but still the form created has action = about:blank. The for has a select. This has been happening only in this function, in other tey work correctly. But they has no select. By the way, how to specify label in a option of the select? Thanks -- 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: from desktop to web2py
Thank you for your help Dave. I try explain myself better: i have a form where the user upload an excel file. I need to process that file, but only some rows of them. And i need to let the user select which rows. Thanks a lot Il giorno venerdì 8 maggio 2015 01:06:11 UTC+2, Dave S ha scritto: > > > > On Thursday, May 7, 2015 at 12:12:20 PM UTC-7, goome wrote: >> >> Thank you for your help Stifan. >> The problem here is that i need to let the user choose among some >> value gotted from the excel file he gave as input. > > > > Do you need to do this before adding anything from the file to the > database? > For instance, only a subset of the data in the file is to be committed? > > This could probably be done on the client side with javascript. There are > some javascript tools > that some of the other posters use for data management. > Joe Barnhart has this recommendation: > >> The jQuery Datatables library is very impressive. It handles sorting, >> filtering, displaying of data in all forms. Its really worth a look at >> http://datatables.net My application is very data-centric and I use a >> LOT of tables, so I built some datatable factory methods to help me. >> > https://groups.google.com/d/msg/web2py/fj_UhjPmhK0/arM06tukVOgJ> > I don't know what you need to do to feed it client data instead of server > data. > > If you want to do this on the server side instead, my first thought is to > [upload the file], import it via CSV import into a *temporary table*, and > then use the data in the temporary table to create the form (SQLFORM, or > its grid offspring), and when you process the form update the permanent > table. > > > > And i should do >> this meanwhile writing other files. > > > I'm not sure what this means. Do you need to have multiple outputs based > on the data, or do you need to multiple threads to speed up the processing? > > >> How can i do this? >> Make all this stuff as an ajax function called after the user select >> the file input? >> > > You could use AJAX/components to provide the view into the temporary > table, if you wanted it to appear on the same page as the input form for > the filename. If you preferred to redirect, then anything you weren't > ready to forget from the filename form could be stored in the session, I > think. > > >> Any easiest way? >> Thanks a lot >> >> > I say this with having done just the littlest bit with forms, and just a > teeny bit more with AJAX, and not much with the new-fangled tools that > javascript gurus are throwing at ^W^W offering us. > > Good luck! > > /dps > (to read the weak joke above, recall what CTRL-W does on the BASH command > line) > > >> >> 2015-05-07 20:56 GMT+02:00, 黄祥 : >> > if you use sqlform.factory, i think you should do the insert data from >> > sqlform.factory to the table manually. >> > e.g. taken from >> > >> http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-factory >> >> > >> > & modified it >> > def form_from_factory(): >> > form = SQLFORM.factory( >> > Field('your_name', requires=IS_NOT_EMPTY()), >> > Field('your_image', 'upload')) >> > if form.process().accepted: >> > response.flash = 'form accepted' >> > db.customer.insert(**db.customer._filter_fields(form.vars) ) >> > elif form.errors: >> > response.flash = 'form has errors' >> > return dict(form=form) >> > >> > another thing, i think you can use another like sqlform, or >> sqlform.grid >> > >> > best regards, >> > stifan >> > >> > -- >> > 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 a topic in the >> > Google Groups "web2py-users" group. >> > To unsubscribe from this topic, visit >> > https://groups.google.com/d/topic/web2py/c247sPk5ALU/unsubscribe. >> > To unsubscribe from this group and all its topics, send an email to >> > web2py+un...@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] from desktop to web2py
Hello I am porting a desktop script to web by means of web2py. The desktop script gets in input some file, process them,make some stuff to sqlitedb, and give as output other xls file. I have already done similar porting for similar script, but the problem now is the in the desktop script after aquiring the input file and beginning to process them,in order to continue the script asked (raw_input) to select a data. Now in the controller/default.py i have a form (sqlform.factory), i wrote the first part of file input processing, but now i should ask for data choice (the data to choice from come from processing the file in input). If i redirect to another view, i suppose i will lose the (in memory) sqlite stuf... Any suggestion to face with 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.
[web2py] DAL insert : how to get an handle?
If i insert a new record on a db , insert return the id of the new record, foes it? So, if i need to preces again the record, before db.commet(), i have to select the db by the new record id, which will give me a list of record (even if there is only one, being the id unique), then select the first record to proceed with update record. Or i am missing something? there isn't any shortcut for this stuff. Example, suppose a table language with a column 'name'. idPython=db.language.insert(name='Python') dataset=db(db.language.id==idPython).select() record=dataset[0] record.update_record(...) record.update_record(...) ect apart form joining the first 2 lines dataset=db(db.language.id==db.language.insert(name='Pascal')).select() there isn't a shortcut record=db.langage.new(name='python') record.update_record(name='ruby') ect ? what return insert if it fails? 0 ? Thanks -- 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/groups/opt_out.
Re: [web2py] Re: web2py not working
You got the point! It was the firewall.Well, i have not yet understood why i have to open manually the port, it seems to me that it should be already open, (as far as i see with iptables -L. Maybe in ubuntu there are rules that are not set and not listed by iptables?). When i start web2py WITH the password (default), i still got that messsage i mentioned (GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed), but web2py seems working anyway. Thanks a lot and i beg your pardon for my post Il giorno mercoledì 15 maggio 2013 13:04:43 UTC+2, Niphlod ha scritto: > > perfect, so that traceback was for starting firefox. now, a further > step: are connections to 8000 allowed by your firewall ? > > Il giorno mercoledì 15 maggio 2013 11:11:26 UTC+2, goome ha scritto: >> >> i tried with web2py.py -a arandompassword >> I didn't get the previos message, and got instedad >> web2py Web Framework >> Created by Massimo Di Pierro, Copyright 2007-2013 >> Version 2.4.6-stable+timestamp.2013.04.06.17.37.38 >> Database drivers available: SQLite(sqlite3), MySQL(pymysql), >> MySQL(MySQLdb), PostgreSQL(psycopg2), PostgreSQL(pg8000), MSSQL(pyodbc), >> DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), IMAP(imaplib) >> please visit: >> http://127.0.0.1:8000/ >> use "kill -SIGTERM 3230" to shutdown the web2py server >> """ >> which i suppose mean that web2py should be working. But still is not >> accesible,neither with firefox, nor w3m nor telnet: >> w3m http://127.0.0.1:8000/ >> w3m: Can't load http://127.0.0.1:8000/. >> telnet localhost 8000 >> Trying 127.0.0.1... >> telnet: Unable to connect to remote host: Connection timed out >> >> >> >> 2013/5/15 Niphlod >> >>> are you sure it's not a problem on starting firefox ? >>> >>> what happens if you try to start web2py with web2py.py -a >>> arandompassword ? >>> >>> Il giorno mercoledì 15 maggio 2013 10:42:28 UTC+2, goome ha scritto: >>>> >>>> Hello >>>> i use ubuntu 13.04 (server version) >>>> uname -a >>>> Linux ubu 3.2.0-29-generic-pae #46-Ubuntu SMP Fri Jul 27 17:25:43 UTC >>>> 2012 i686 i686 i686 GNU/Linux >>>> I upgraded python from 2.7.3 to 2.7.4 (because of the known problem >>>> with 2.7.3 : >>>> Now i don't getException AttributeError: AttributeError("'_DummyThread' >>>> object has no attribute '_Thread__block'",)) >>>> Now this problem with the tread is disappeared but still web2py is not >>>> working. >>>> From the shell i got: >>>> GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' >>>> failed >>>> >>>> Any suggestion? >>>> Thanks >>>> >>> -- >>> >>> --- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "web2py-users" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/web2py/A4hAEvwl1-U/unsubscribe?hl=en. >>> To unsubscribe from this group and all its topics, send an email to >>> web2py+un...@googlegroups.com. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> -- --- 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/groups/opt_out.
[web2py] web2py not working
Hello i use ubuntu 13.04 (server version) uname -a Linux ubu 3.2.0-29-generic-pae #46-Ubuntu SMP Fri Jul 27 17:25:43 UTC 2012 i686 i686 i686 GNU/Linux I upgraded python from 2.7.3 to 2.7.4 (because of the known problem with 2.7.3 : Now i don't getException AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",)) Now this problem with the tread is disappeared but still web2py is not working. >From the shell i got: GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed Any suggestion? Thanks -- --- 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/groups/opt_out.
[web2py] Re: Possible problem with cron using python 2.7.3 and Ubuntu 12.04
I got the same error with the same python and ubuntu. did you solve in some manner? Thanks Il giorno lunedì 7 maggio 2012 05:40:11 UTC+2, Nick Noel ha scritto: > > Hello, > I find that I get the following error on startup: > > Starting hardcron... > please visit: > http://127.0.0.1:8000 > starting browser... > Exception AttributeError: AttributeError("'_DummyThread' object has no > attribute '_Thread__block'",) in '/usr/lib/python2.7/threading.pyc'> ignored > > Furthermore, > I find that each time a cronjob is scheduled to kick off I get the same > error. This seems to prevent the job from starting up. > > A little research led me to the following Python bug report: > http://bugs.python.org/issue14308 > > Has anyone else experienced this? > > Thanks, > --Nick > -- --- 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/groups/opt_out.