[web2py] how to display the value of a reference field, instead of the id in sqlform.grid

2012-10-07 Thread dave
grid = SQLFORM.grid(query, args=[request.args(0)], fields=[db.auth_user.test0, db.auth_user.test1, db.auth_user.test2, I have defined this in my controller, the value of test1 is a referen

[web2py] IS_IN_DB and IS_IN_SET dont work insied INPUT

2012-10-07 Thread dave
I have the following code def test(): # gets fired for first page load, it loads the filter applicants form on the left side form = SQLFORM(db.auth_user, request.args(0), buttons=[], separator = ' ', formstyle = 'divs', deletable=True, fields = ['test1', 'test2', 'test3'],upload =URL(r=req

[web2py] Google App Auth

2012-10-07 Thread Kenneth
Hello everyone, I have an application where I'd like use an Google App account for authentication. The application will not reside on GAE. Is this possible? If I put "from gluon.contrib.login_methods.gae_google_account import GaeGoogleAccount" in my models file I get: ImportError: No module n

[web2py] Error importing dropbox_account module

2012-10-07 Thread rogier
L.S. On both my pythonanywhere and my local web2py instance I seem to be unable to import the dropbox module from gluon. When incorporating this code in db.py from gluon.contrib.login_methods.dropbox_account import use_dropbox use_janrain(auth,filename='private/dropbox.key') mydropbox = auth.set

[web2py] Internal error Ticket issued: unrecoverable when starting web2py

2012-10-07 Thread GoFrendi Gunawan
I've just download the newest version of web2py since the one included in ubuntu repository is outdated (1.9.9) https://github.com/web2py/web2py/tree/e1bb2b4556352612a8f0386373d23e49f3e138c4 As instructed, I execute web2py.py But I get Internal error Ticket issued: unrecoverable I've try to click

[web2py] Problems with list:reference and SQLFORM

2012-10-07 Thread VP
SQLFORM represents a reference field as a multiply-selected drop-down list, this presents two problems: (1). If the referenced table has 10,000 entries, then they will be shown. It's inefficient. But it's somewhat unavoidable, given what it is. (2). The other problem is more serious. A mult

[web2py] Re: Problems with list:reference and SQLFORM

2012-10-07 Thread Anthony
> > (1). If the referenced table has 10,000 entries, then they will be shown. > It's inefficient. But it's somewhat unavoidable, given what it is. Yes, you're probably better off using an autocomplete widget in a case like that. (2). The other problem is more serious. A multiply-selected

[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread Anthony
There are two separate issues -- the validation of the submitted values, and the widget displayed in the form to input the values. In your case, the validation should still work, but you won't get the widget because the widget is added by the SQLFORM __init__ method, which is called before you

[web2py] Re: how to display the value of a reference field, instead of the id in sqlform.grid

2012-10-07 Thread Anthony
How is your "test1" field defined? On Sunday, October 7, 2012 3:26:31 AM UTC-4, dave wrote: > > > grid = SQLFORM.grid(query, args=[request.args(0)], > fields=[db.auth_user.test0, > db.auth_user.test1, >

[web2py] Re: Error importing dropbox_account module

2012-10-07 Thread Massimo Di Pierro
You need to install: https://github.com/enginous/python-dropbox On Sunday, 7 October 2012 06:17:20 UTC-5, rogier wrote: > > L.S. > > On both my pythonanywhere and my local web2py instance I seem to be unable > to import the dropbox module from gluon. > > When incorporating this code in db.py > f

[web2py] Re: Custom forms controller and view separation of concerns

2012-10-07 Thread Anthony
Depending on what you want to do on the processing side and what you want to do on the display side, you probably don't have to completely repeat everything. You can use form.custom.widget.fieldname in the view if that is suitable. You can also use the server-side DOM to add classes, etc. Anothe

Re: [web2py] Re: scheduler: Cannot duplicate a Singleton

2012-10-07 Thread Adnan Smajlovic
The task executed properly, marked status "COMPLETED" in scheduler_task table, but didn't insert a record into scheduler_run table. I will create a new mysql database and let you know if the problem is there... On Sun, Oct 7, 2012 at 2:12 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote

Re: [web2py] Re: scheduler: Cannot duplicate a Singleton

2012-10-07 Thread Niphlod
are you aware that if your task doesn't return nothing and doesn't go into exception the new scheduler will erase the scheduler_run record ? On Sunday, October 7, 2012 7:57:52 PM UTC+2, Adi wrote: > > The task executed properly, marked status "COMPLETED" in scheduler_task > table, but didn't ins

[web2py] Re: possible bug on scheduler

2012-10-07 Thread Niphlod
tested with latest trunk, I can't reproduce. Can you try it again with commit 09f2925 Vincenzo ? On Sunday, October 7, 2012 12:33:53 AM UTC+2, Massimo Di Pierro wrote: > > Yes there are problems with the scheduler but it not because of the > scheduler. It is because of the DAL has changed signif

Re: [web2py] Re: scheduler: Cannot duplicate a Singleton

2012-10-07 Thread Adnan Smajlovic
Oh Niphlod :) No, I wasn't aware of that... In that case it works as expected :) I created a new db, and introduced a return value, which caused a record into into scheduler_run with status "COMPLETED", and additional details in "result" field. This is perfect... Thank you very much for scheduler

[web2py] Re: how to display the value of a reference field, instead of the id in sqlform.grid

2012-10-07 Thread dave
auth.settings.extra_fields['auth_user']= [ #Field('name', requires=IS_NOT_EMPTY()), . . . Field('test1', 'reference ranking', requires=IS_IN_DB(db, 'ranking.id', '%(name)s')), . . . On Sunday, October 7, 2012 7:37:03 AM UTC-7, Anthony wrote: > > How is your "test1" field defined?

[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread dave
ok I got it to display using select() SELECT(_type='text', _name='test0', requires=IS_IN_DB(db, db.tiers.type, '%(type)s'))) now the problem is it wont populate the options of the dropdown box from the database On Sunday, October 7, 2012 7:33:54 AM UTC-7, Anthony wrote: > > There are two se

[web2py] Re: Error importing dropbox_account module

2012-10-07 Thread rogier
That indeed solved the problem. Thank you for the very quick response! Kind Regards Rogier --

[web2py] web2py-appliance updates and support

2012-10-07 Thread dhmorgan
I volunteer to help with updating and supporting web2py-appliances. Perhaps this thread can be used to share thoughts and observations about doing so. --

Re: [web2py] Re: scheduler: Cannot duplicate a Singleton

2012-10-07 Thread Niphlod
It's not the scheduler code that has changed/improved, it's a major change in DAL code that needed some tune-ups. That same change in DAL needs to be tested throughly, but I think nightly builds will come soon. On Sunday, October 7, 2012 8:44:04 PM UTC+2, Adi wrote: > > Oh Niphlod :) No, I wasn'

[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread Niphlod
that's because web2py doesn't know what you expect to be filled in your model. If you add the requires= bit to your "type" field, then automatically web2py will turn that field into a SELECT with the correct options. On Sunday, October 7, 2012 9:01:48 PM UTC+2, dave wrote: > > ok I got it to d

[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread dave
I did requires=IS_IN_DB(db, db.tiers.type, '%(type)s') On Sunday, October 7, 2012 1:57:06 PM UTC-7, Niphlod wrote: > > that's because web2py doesn't know what you expect to be filled in your > model. If you add the requires= bit to your "type" field, then > automatically web2py will turn that fi

Re: [web2py] Re: possible bug on scheduler

2012-10-07 Thread Vincenzo Ampolo
On 10/07/2012 11:26 AM, Niphlod wrote: > tested with latest trunk, I can't reproduce. Can you try it again with > commit 09f2925 Vincenzo ? I'll. -- Vincenzo Ampolo http://vincenzo-ampolo.net http://goshawknest.wordpress.com --

[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread Anthony
On Sunday, October 7, 2012 4:57:06 PM UTC-4, Niphlod wrote: > that's because web2py doesn't know what you expect to be filled in your > model. If you add the requires= bit to your "type" field, then > automatically web2py will turn that field into a SELECT with the correct > options. > It won'

[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread Anthony
Yes, you have to include the options in the SELECT() -- the SELECT() doesn't know it should get the options from the IS_IN_DB validator. Anthony On Sunday, October 7, 2012 3:01:48 PM UTC-4, dave wrote: > > ok I got it to display using select() > > SELECT(_type='text', _name='test0', requires=I

[web2py] Re: how to display the value of a reference field, instead of the id in sqlform.grid

2012-10-07 Thread Anthony
If you do: Field('test1', 'reference ranking') and then make sure the "format" attribute of the "ranking" table is set to '%(name)s', then the "test1" field will automatically get the IS_IN_DB validator you have explicitly defined below, and it will automatically get a "represent" attribute di

[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread dave
so how do I go about doing that, I have this so far SELECT(_type='text', _name='test0', requires=IS_IN_DB(db, db.tiers.type, '%(type)s'))) On Sunday, October 7, 2012 6:21:49 PM UTC-7, Anthony wrote: > > Yes, you have to include the options in the SELECT() -- the SELECT() > doesn't know it shoul

[web2py] Re: how to display the value of a reference field, instead of the id in sqlform.grid

2012-10-07 Thread dave
Thank you very much, I did not see this in the documentation and yes it would be nice if it is consistent with your expectation On Sunday, October 7, 2012 6:25:09 PM UTC-7, Anthony wrote: > > If you do: > > Field('test1', 'reference ranking') > > and then make sure the "format" attribute of the "

[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread Anthony
Something like: SELECT(*[r.type for r in db().select(db.tiers.type)], ...) SELECT() takes OPTION() elements as its components, but if you give it items not wrapped in OPTION, it will automatically do so. Anthony On Sunday, October 7, 2012 9:42:06 PM UTC-4, dave wrote: > > so how do I go about

[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread dave
Thank you again, you solved two problems of mine today On Sunday, October 7, 2012 7:23:04 PM UTC-7, Anthony wrote: > > Something like: > > SELECT(*[r.type for r in db().select(db.tiers.type)], ...) > > SELECT() takes OPTION() elements as its components, but if you give it > items not wrapped in O

[web2py] google wallet problem

2012-10-07 Thread greaneym
I am trying to get the level one integration of google wallet working as described in the manual. Here is the view: {{extend 'layout.html'}} Checkout {{from gluon.contrib.google_wallet import button}} {{=button(merchant_id=my_merchantid, products=[dict(names="shoes",

[web2py] Re: google wallet problem

2012-10-07 Thread Massimo Di Pierro
Hello Margaret, can you please email me the code you have? I am not sure I have the same. Anyway this: button = 'https://sandbox.google.com/checkout/api/checkoutForm/Merchant/%s"; id="BB_BuyButtonForm" method="post" name="BB_BuyButtonForm" target="_top">%shttp://sandbox.google.com/checkout/bu