[web2py] register recepatcha not working

2011-09-17 Thread Avik Basu
I am using recaptcha using the following code (public and private keys not shown): auth.settings.register_captcha = Recaptcha(request, '', 'yy', use_ssl=False, error_message='please complete the reCaptcha') I've registered with recaptcha.net and I not running this from a localho

[web2py] logging cannot create a log file when run from web2py

2010-10-27 Thread Avik Basu
rt logging logging.basicConfig(filename='logging.log',level=logging.INFO) logging.info('test') #command used to run the above file python web2py.py -M -N -S test -R applications/test/cron/log.py & Thanks. Avik Basu

[web2py] Re: expose URL to internal web2py functions

2010-09-21 Thread Avik Basu
cess with @auth.requires_login() or other auth > recorator. > > On Sep 20, 6:48 pm, Avik Basu wrote: > > > > > I have a generic function called edit_db which allows for editing of > > database records and is useful for ajax-related form functions such as > > edit-in-plac

[web2py] expose URL to internal web2py functions

2010-09-20 Thread Avik Basu
I have a generic function called edit_db which allows for editing of database records and is useful for ajax-related form functions such as edit-in-place. The URL that is exposed is something like edit_db/tablename/row_id/fieldname?value="newvalue" I would like to make sure that this function ca

[web2py] Re: URL error in appadmin

2010-09-18 Thread Avik Basu
I tried your suggestion and tracked the error to the following line which was in my db.py: from gluon.sqlhtml import * I guess this import overrided the URL function. When I took it out, everything works. Thanks so much for your patience and helping me get through this issue so methodically! T

[web2py] Re: URL error in appadmin

2010-09-18 Thread Avik Basu
On Sep 18, 2010, at 1:24 PM, Avik Basu wrote: > > > > > > > > > I put this: > > {{=URL.__name__}} > > > in the view of my index page and it showed > > URL > > > (not _URL as you said) > > > Also, I don't know if its helpful to me

[web2py] Re: URL error in appadmin

2010-09-18 Thread Avik Basu
}} in my index page, I get the same syntax error that I had in appadmin. On Sep 18, 4:10 pm, Jonathan Lundell wrote: > On Sep 18, 2010, at 12:52 PM, Avik Basu wrote: > > > > > Line 219 of gluon/compileapp.py is as you described it. I also deleted > > the whole gluon direct

[web2py] Re: URL error in appadmin

2010-09-18 Thread Avik Basu
do i need to import logging? On Sep 18, 4:10 pm, Jonathan Lundell wrote: > On Sep 18, 2010, at 12:52 PM, Avik Basu wrote: > > > > > Line 219 of gluon/compileapp.py is as you described it. I also deleted > > the whole gluon directory and downloaded the latest sou

[web2py] Re: URL error in appadmin

2010-09-18 Thread Avik Basu
following syntax error: SyntaxError: URL: a=index c=None f=None r=None u=URL On Sep 18, 3:33 pm, Jonathan Lundell wrote: > On Sep 18, 2010, at 11:52 AM, Avik Basu wrote: > > > > > After restarting the server, I get the following error: > > > SyntaxError: URL: a=index c=N

[web2py] Re: URL error in appadmin

2010-09-18 Thread Avik Basu
After restarting the server, I get the following error: SyntaxError: URL: a=index c=None f=None r=None On Sep 18, 2:46 pm, Jonathan Lundell wrote: > On Sep 18, 2010, at 11:40 AM, Avik Basu wrote: > > > > > When I replace the code in gluon/html.py, I still keep getting the &g

[web2py] Re: URL error in appadmin

2010-09-18 Thread Avik Basu
delete the html.pyc file. Do I need to restart the server? On Sep 18, 2:31 pm, Jonathan Lundell wrote: > On Sep 18, 2010, at 9:46 AM, Avik Basu wrote: > > > > > Sure, I'm happy to help debug.  Send me the print statements when you > > get a chance. > > FWIW, I just

[web2py] Re: URL error in appadmin

2010-09-18 Thread Avik Basu
Sure, I'm happy to help debug. Send me the print statements when you get a chance. Avik On Sep 18, 12:39 pm, Jonathan Lundell wrote: > On Sep 17, 2010, at 11:50 PM, Avik Basu wrote: > > > > > There is nowhere I can see that I am altering request in the models. > >

[web2py] Re: URL error in appadmin

2010-09-17 Thread Avik Basu
There is nowhere I can see that I am altering request in the models. What is the specific reason that request would break the URL function? Any other ideas what the problem could be? Avik On Sep 17, 7:57 pm, Jonathan Lundell wrote: > On Sep 17, 2010, at 4:44 PM, Avik Basu wrote: > >

[web2py] Re: URL error in appadmin

2010-09-17 Thread Avik Basu
tion (http://127.0.0.1:8000/FWv9_1_Avik/appadmin/index). Is there some other file I need to copy? Avik On Sep 17, 7:24 pm, Jonathan Lundell wrote: > On Sep 17, 2010, at 4:06 PM, Avik Basu wrote: > > > > > Hi, > > > I get the following error in appadmin.py which I copied ove

[web2py] URL error in appadmin

2010-09-17 Thread Avik Basu
Hi, I get the following error in appadmin.py which I copied over from the welcome app in version 1.85.2: Traceback (most recent call last): File "/Volumes/Data/avikbasu/web2py/gluon/restricted.py", line 188, in restricted exec ccode in environment File "/Volumes/Data/avikbasu/web2py/appli

[web2py] Re: StorageList error on Dreamhost installation [SOLVED]

2010-09-14 Thread Avik Basu
I restarted the server and the issue was resolved. Sorry for the bother. Avik On Sep 14, 6:24 pm, Avik Basu wrote: > Hi, > > I get the following error when loading web2py version 1.84.4 on > Dreamhost: > > Traceback (most recent call last):\n  File "gluon/restric

[web2py] StorageList error on Dreamhost installation

2010-09-14 Thread Avik Basu
Hi, I get the following error when loading web2py version 1.84.4 on Dreamhost: Traceback (most recent call last):\n File "gluon/restricted.py", line 178, in restricted in code it raises a RestrictedError containing the traceback. layer is \n File "/home/pwoolf/foodwiki.com/applications/init/mod

[web2py] prevent redirect when using crud.delete

2010-09-14 Thread Avik Basu
Hello, Is there a way to prevent crud.delete from redirecting to a new page. The reason I want to do this is that I am calling crud.delete via web2py's LOAD function? I am trying this: form = crud.delete(db.ate,ate_id, next='') I notice in the code that crud.update explicitly checks for an empt

[web2py] MySQL query with empty belongs

2010-07-12 Thread Avik Basu
Hi, I am trying to run a query with the web2py "belongs" statement where sometimes the value passed to the belongs may be empty. For example, a=[] rows = db(db.food.id.belongs(a)).select() The database I'm using is MySQL and I get the following error: Traceback (most recent call last): File

[web2py] Re: synchronize tables in two databases

2010-06-28 Thread Avik Basu
any tables for it in the model? Avik On Jun 28, 4:06 pm, mdipierro wrote: > import cStringIO > s=cStringIO.StringIO() > > after the same tables are defined for both dbs: > > db2.export_to_csv_file(s) > s.seek(0) > db1.import_form_csv_file(s) > > On 28 Giu, 13:

[web2py] synchronize tables in two databases

2010-06-28 Thread Avik Basu
Hi, I'm trying to synchronize two databases that are similar but not exactly the same. I would like to create two connections (db1 and db2) and go through table by table to do the synchronization. db1 = DAL('sqlite://storage.db') db2 = DAL('mysql://username:passw...@mysql.test.com/test_db', pool

[web2py] An error occurred importing your passenger_wsgi.py

2010-05-31 Thread Avik Basu
I am running on web2py 1.78.3 on a shared server on Dreamhost and I am getting the following error: An error occurred importing your passenger_wsgi.py It seems like a PATH issue but I'm not sure. Any ideas what might be causing this? Avik

[web2py] Re: MySQL failure to connect [SOLVED]

2010-05-19 Thread Avik Basu
Turns out I was not running from source. Thanks for your help! Avik On May 19, 7:53 am, Alexandre Andrade wrote: > the correct driver is not python-mysql, but mysqldb. > > 2010/5/18 Avik Basu > > > > > > > Hello, > > > I am having some trouble con

[web2py] MySQL failure to connect

2010-05-18 Thread Avik Basu
Hello, I am having some trouble connecting to a MySQL server running on my local machine (Macbook Pro running Snow Leopard with My SQL 5.1.46). I use the following connection string: db = DAL('mysql://root:passw...@localhost/test', pool_size=10) and I get the following error: Traceback (most re

[web2py] Re: cache.disk.clear

2010-05-04 Thread Avik Basu
e the latest web2py? > > This seems to work for me. > > > On May 3, 6:25 pm, Avik Basu wrote: > > > > Hi, > > > > I have installed a site on dreamhost and whenever I issue the command > > > "cache.disk.clear" in an action, I get an "inval

[web2py] cache.disk.clear

2010-05-03 Thread Avik Basu
Hi, I have installed a site on dreamhost and whenever I issue the command "cache.disk.clear" in an action, I get an "invalid function" error. I thought this could be a permissions problem for the cache directory or cache.shelve, so I added read/write permissions for everyone, but it didn't seem t

[web2py] restart web2py command line

2010-04-29 Thread Avik Basu
Hi, Is there a way to restart web2py from the command line in a linux environment? Avik

[web2py] crud next with lambda

2010-04-14 Thread Avik Basu
Hi, Is it possible to use a lambda function within the next argument in a crud create? I would like to redirect the user to a new page based on the id of the record that was just created. Example: form=crud.create(db.person, next= lambda form: redirect(URL(r=request,f='another_form',arg

[web2py] Re: LOAD and reload

2010-04-09 Thread Avik Basu
',ajax=True)}} > > do > > web2py_component('{{=URL(r=request,c='default',f='show_foods')}}',' > mystuff')</ > script> > > You can also have > > <button > onclick="web2py_component('{{=URL(r=request,c='default'

[web2py] LOAD and reload

2010-04-09 Thread Avik Basu
Hi, Is there a way to reload a component that has been loaded with the LOAD function without sending a request back to the server? For example, I would like to reload a list of foods whenever the data has been altered by the user, but I would like only the component to reload instead of the whole

[web2py] Re: crud update with represent

2010-04-03 Thread Avik Basu
ld("food_id", db.food) > ) > > #controller > form=crud.update(db.ate,ate_id) > > On Apr 1, 2:22 pm, Avik Basu wrote: > > > > > Hi, > > As I understand, when crud.update(...) creates a form it pulls the > > values of a given record into the form

[web2py] crud update with represent

2010-04-01 Thread Avik Basu
Hi, As I understand, when crud.update(...) creates a form it pulls the values of a given record into the form as a string. If the field is a reference to another table, then this shows up as a number. I would like to instead show the name of the record instead of the id. I have a represent functi

[web2py] Re: datetime and represent

2010-03-28 Thread Avik Basu
trunk or also in > 1.76.5. Which web2py version do you use? > > Massimo > > On Mar 28, 6:18 pm, Avik Basu wrote: > > > > > I dropped all the records in the table and still get the same result. > > I replaced the previous represent with: > > > represent = lam

[web2py] Re: datetime and represent

2010-03-28 Thread Avik Basu
rrupted data. > > Massimo > > On Mar 28, 4:54 pm, Avik Basu wrote: > > > > > I would like to use the represent function on a datetime object, like > > so: > > > from datetime import * > > > db.define_table("adate", > >   Field

[web2py] datetime and represent

2010-03-28 Thread Avik Basu
I would like to use the represent function on a datetime object, like so: from datetime import * db.define_table("adate", Field("date","datetime", represent = lambda x: x.strftime("%a %m-%d-%y") if x else 'No time' #convert datetime object to string ) ) This works when I create a form,

[web2py] Re: Passing values to widgets

2010-03-27 Thread Avik Basu
s_widget(food_id) > > On Mar 27, 4:05 pm, Avik Basu wrote: > > > > > Also, if i wanted to extend SQLFORM.widgets.options.widget, how would > > i go about doing that? Is it as simple as replacing: > > > class Units_Widget(object): > > > with: > > >

[web2py] Re: Passing values to widgets

2010-03-27 Thread Avik Basu
Also, if i wanted to extend SQLFORM.widgets.options.widget, how would i go about doing that? Is it as simple as replacing: class Units_Widget(object): with: class Units_Widget(SQLFORM.widgets.options.widget): Thanks, Avik On Mar 27, 5:03 pm, Avik Basu wrote: > I get the following er

[web2py] Re: Passing values to widgets

2010-03-27 Thread Avik Basu
; >         def widget(f,v): > >            #build your widget > >            #using args > >         return widget > > > db.ate.units.widget = Units_Widget(food_id) > > > On Mar 27, 10:42 am, Avik Basu wrote: > > > > So, for my example, I tried y

[web2py] Re: Passing values to widgets

2010-03-27 Thread Avik Basu
would be the proper way to call the widget constructor? Avik On Mar 27, 12:02 am, mdipierro wrote: > in the controller you can do > > db.table.field.widget = SomeWidgetConstructor(args) > > Not sure if this is what you are asking. > > On 26 Mar, 18:26, Avik Basu wrote: >

[web2py] Passing values to widgets

2010-03-26 Thread Avik Basu
Is there a way to pass arguments to a field's widget from the controller? For example: db.define_table("food", Field("name", "string'")) db.define_table("units", Field("food_id", db.food), Field("name", "string") ) db.define_table("ate", Field("food_id", db.food), Field("quantity",

[web2py] Re: widgets in db.py

2010-03-21 Thread Avik Basu
t; D_db.py > > -Thadeus > > > > On Sat, Mar 20, 2010 at 1:17 PM, mdipierro wrote: > > models are executed alphabetically. You have two options: > > 1) rename one of the files: > > 2) move the widgets to a module and import the module from db.py > > > On

[web2py] widgets in db.py

2010-03-20 Thread Avik Basu
Hi, I have a several widgets in a file called widgets.py and would like to use those widgets in db.py. Both db.py and widgets.py exist in the models directory. However, when I use the widgets in defining table fields in db.py, it does not recognize the widgets. How can I include the widgets.py

[web2py:33386] Re: OPTION selected problem

2009-10-21 Thread Avik Basu
e="..." > > OPTION('candy', _selected="selected", _value=1) should produce what you are > looking for. > > However, when using SQLFORM the default selection can be set as well when > you specify field.default =... > > -Thadeus > > On Wed,

[web2py:33383] OPTION selected problem

2009-10-21 Thread Avik Basu
Hello, I am a Web2Py newbie trying to use the OPTION helper to create a dropdown menu that will select the appropriate option. I expect that OPTION('candy', _value=1, value=1) should produce candy but it only produces candy Am I doing something wrong? Thanks. Avik --~--~-~--~