[web2py] Re: pythonanywhere, what's the adnmin password ?

2014-01-25 Thread Massimo Di Pierro
They give you one when you create the account. It is different for every user, even if you use the try-web2py option. Nobody else knows it. If you forgot it or did not write it down, try contact them. On Saturday, 25 January 2014 18:07:03 UTC-6, aapaap wrote: > > thanks, > Stef > -- Resource

[web2py] Send local script results to web2py

2014-01-25 Thread Avi A
Hi, Assuming I want to run a testing script locally and send the test results to a web2py app. Would that be the way to do it? #local script import requests test_results = {'api_key': x, 'Fail': 'etc'} r = requests.get("somedomain.com/default/api/*get*", params=test_results) # link def api()

[web2py] pythonanywhere, what's the adnmin password ?

2014-01-25 Thread Stef Mientki
thanks, Stef -- 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" grou

[web2py] Re: New record creates on Select?

2014-01-25 Thread Luciano Laporta Podazza
Oh guys, I'm terribly ashamed, sorry for such a lame post from me. Thanks for your time and consideration. As always, you rock guys :) Cheers! On Saturday, January 25, 2014 8:35:33 PM UTC-3, Anthony wrote: > > SQLFORM is designed for inserting records into the database, so this is > not a bug.

[web2py] Re: New record creates on Select?

2014-01-25 Thread Anthony
SQLFORM is designed for inserting records into the database, so this is not a bug. By default, SQLFORM.process() does an insert. To avoid that, you could do SQLFORM.process(..., dbio=False), or just do SQLFORM.validate() instead (.validate doesn't do an insert by default). Anthony On Saturday,

Re: [web2py] New record creates on Select?

2014-01-25 Thread Roberto Perdomo
With "SQLFORM(db.mascotas," you generate a form with Database (insert/update/delete), try using SQLFORM.factory or SQLFORM without database IO ( http://www.web2py.com/book/default/chapter/07#SQLFORM-without-database-IO) 2014/1/25 Luciano Laporta Podazza > Hello, > > I created a form(SQLFORM) to

[web2py] New record creates on Select?

2014-01-25 Thread Luciano Laporta Podazza
Hello, I created a form(SQLFORM) to perform a search(without using crud.search) and for some reason, every time I do a search, a new record is created with default values. I really don't know if I'm doing something wrong or is it a bug. Tested with Web2py 2.8.2 on Mac OS X 10.9.1 and MySQL 5. A

[web2py] Re: forgot password not working anymore

2014-01-25 Thread pang
El viernes, 24 de enero de 2014 10:40:20 UTC+1, Bastiaan van der Veen escribió: > > > The problem is I get no exception, error or something else. The form posts > and then reloads as if nothing happened. > Does it work on the default welcome app? And anyway, what's your web2py version? -- Re

[web2py] Re: Form validation - Either choose from the dropdown or upload a file

2014-01-25 Thread Massimo Di Pierro
def do_proc(): form = SQLFORM.factory( Field('your_data', requires=IS_EMPTY_OR(IS_IN_DB(db,db.udata.id ,'%(title)s'))), Field('your_file', 'upload', requires=IS_NOT_EMPTY() if not request.vars.your_data else None)) form.process() On Saturday, 25 January 2014 07:56:23 UTC-6

[web2py] Re: web2py multiple records in 1 form or in wizard

2014-01-25 Thread Massimo Di Pierro
You can use session to pre-populate the form. def reserve(): db.reservations.PersonName = session.PersonName form = SQLFORM(db.reservations) if form.process().accepted: session.PersonName = form.vars.PersonName return dict(form=form) On Friday, 24 January 2014 23:4

[web2py] Re: Is there a way to cache images from "download" function?

2014-01-25 Thread James Burke
I tried using the above code, but results in the follow error message: cache.client(time_expire=604800, quick='SVL')(lambda: 0)() AttributeError: 'Cache' object has no attribute 'client' Am I missing something? Cheers -James On Monday, April 15, 2013 1:21:18 AM UTC+12, Niphlod wrote: > >

[web2py] Re: SQLFORM.grid ondelete not working

2014-01-25 Thread Anthony
On Saturday, January 25, 2014 2:13:21 PM UTC-5, horridohobbyist wrote: > > How can I trigger JS code from a delete operation? Anything in the view or > controller would not know (and would not be notified) that SQLFORM.grid had > just performed a delete. > When a delete is performed, an ajax req

[web2py] Re: SQLFORM.grid ondelete not working

2014-01-25 Thread horridohobbyist
How can I trigger JS code from a delete operation? Anything in the view or controller would not know (and would not be notified) that SQLFORM.grid had just performed a delete. BTW, client_side_delete is not recognized and generates a ticket. On Saturday, 25 January 2014 13:05:40 UTC-5, Anthony

[web2py] Form validation - Either choose from the dropdown or upload a file

2014-01-25 Thread desta
Hello, I am a complete beginner building my first web application with web2py. I have a form that displays a dropdown list and also has a file upload option. I want the user to do one of the two. Either choose an entry from the list or upload a file. I cannot figure out a way to do it with vali

[web2py] Re: Radio Buttons layout problem with trunk

2014-01-25 Thread Jeremy Field
Thanks Pablo. I think another two lines dealing with input[type='checkbox'] are also needed. Regards, Jeremy On Friday, 19 July 2013 01:51:15 UTC+10, Paolo Caruccio wrote: > > Please put the following code in your custom css file (or in the bottom of > web2py_bootstrap.css if you are using the

[web2py] Re: SQLFORM.grid ondelete not working

2014-01-25 Thread Anthony
Oh yes, good point -- the delete operation happens via Ajax, so the grid full page is not reloaded. You can try SQLFORM.grid(..., client_side_delete=True), though not sure that will work if the grid isn't inside a component. Another option is to set response.js to some JS code to update the sum

[web2py] Re: SQLFORM.grid ondelete not working

2014-01-25 Thread horridohobbyist
Thanks for the tip about database sum. I've also moved most of the logic into the controller. However, your suggestion that the database sum should occur *after* the SQLFORM.grid is incorrect. I tried it. The problem seems to be that the page is not refreshed after a *delete*, whereas the page

[web2py] Re: adding item to tuple

2014-01-25 Thread Annet
Thank you both for your replies. I did as Martin suggests: In the module file: FREETIER1_NAVLIST=[STYLESHEETNAVID, SMARTLINKSNAVID, DOWNLOADVCARDNAVID, QRCODENAVID, HEADLINENAVID] In the controller: navlist=[UPDATEACCOUNTNAVID] if interfaceCategoryID==FREETIER1ID: navlist= navlist + FREET

[web2py] Re: Variables from url

2014-01-25 Thread Lucas Schreiber
Thanks :) It is exactly what i needed :) -- 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 Googl

[web2py] Re: SQLFORM.grid redirects and access

2014-01-25 Thread Anthony
Your problem is not user_signature but the fact that your familiares_socio_manage function requires request.args(0) to generate the appropriate query, but you don't tell the grid about this, so when it generates its internal URLs, it doesn't preserve your request.args(0). As a result, the reque

[web2py] Re: adding item to tuple

2014-01-25 Thread Anthony
> > navlist=navlist + tuple(row.navID) > Tuples are immutable, so you cannot add to them. However, as you have done above, you can add two tuples to create a new tuple. So, just do: navlist=navlist + tuple(UPDATEACCOUNTNAVID) On the other hand, as Martin suggests, it may be more appropriat

[web2py] Re: SQLFORM.grid ondelete not working

2014-01-25 Thread Anthony
The line in question comes *before* SQLFORM.grid is called (which is where the delete happens), so the delete hasn't yet happened at that point. A couple other points: - You should really keep your code in the controller and limit your view file to display logic. - You can have the dat

[web2py] Re: SQLFORM.grid ondelete not working

2014-01-25 Thread horridohobbyist
Okay, I know the problem now. After a delete is performed, the line indicated by the comment below still thinks that the record is there, even though the record is verifiably absent when I check in Database Administration! It almost looks like a caching problem. I tried a db.commit() before the

[web2py] Re: SQLFORM.grid ondelete not working

2014-01-25 Thread horridohobbyist
Never mind my last message. I'm still not sure it's being called. I need to investigate further. On Saturday, 25 January 2014 05:47:35 UTC-5, horridohobbyist wrote: > > Oh, it's called BEFORE the delete! That's why I was getting unexpected > results. > > I need to perform an action AFTER the de

[web2py] Re: SQLFORM.grid ondelete not working

2014-01-25 Thread horridohobbyist
Oh, it's called BEFORE the delete! That's why I was getting unexpected results. I need to perform an action AFTER the delete. Is there a workaround? Thanks. On Saturday, 25 January 2014 01:00:25 UTC-5, Anthony wrote: > > Does the record actually get deleted from the database? If so, ondelete >

Re: [web2py] adding item to tuple

2014-01-25 Thread Martin Weissenboeck
Try to use a list: FREETIER1_NAVLIST=[STYLESHEETNAVID,SMARTLINKSNAVID,DOWNLOADVCARDNAVID, QRCODENAVID,HEADLINENAVID] navlist=None # no change if interfaceCategoryID==FREETIER1ID: navlist=FREETIER1_NAVLIST What is the type of row.navID? Is it a list? Use: if row.navID: navlis

[web2py] adding item to tuple

2014-01-25 Thread Annet
In a module I have the following constant: FREETIER1_NAVLIST=STYLESHEETNAVID,SMARTLINKSNAVID,DOWNLOADVCARDNAVID,QRCODENAVID,HEADLINENAVID where ...NAVID is an int, like STYLESHEETNAVID=29 In a function I have: navlist=None if interfaceCategoryID==FREETIER1ID: navlist=FREETIER1_NAVLIST

[web2py] web2py multiple records in 1 form or in wizard

2014-01-25 Thread Davy Jacops
In web2py, making a ticket reservation form Simplified db view: db.define_table('shows', Field('ShowName', 'string')) db.define_table('reservations', Field('PersonName','string'), Field('NbrOfTickets','integer'), Field('show_id',db.shows)) db.

[web2py] web2py multiple records in 1 form or in wizard

2014-01-25 Thread Davy Jacops
In web2py, making a ticket reservation form Simplified db view: db.define_table('shows', Field('ShowName', 'string')) db.define_table('reservations', Field('PersonName','string'), Field('NbrOfTickets','integer'), Field('show_id',db.shows)) db

[web2py] Re: web2py slices plugins: thumbnail images

2014-01-25 Thread Alan Etkin
> > Too bad that many of the growing collection of plugins don't have a > thumbnail image :( > Agree. Maybe the book note can improve the feature's user feedback. BTW: the current layout is not too pretty. Any help about coding a better view is welcome. -- Resources: - http://web2py.com - h

[web2py] Re: SQLFORM.grid redirects and access

2014-01-25 Thread Jacinto Parga
Hi, I have a similar issue: Model: db.define_table('t_familiares', Field('f_parentesco', type='string', label=T('Parentesco'), requires = IS_IN_SET(['Conyuge', 'Hija','Hijo','Padre','Madre','Pareja'], zero=T('Elige uno'), error_message='Escoge una opción válida')), Field('f_nombre', ty