[web2py] Re: How to create a module

2010-12-08 Thread Vikram
Still its giving the same error. I have placed file checkrole.py under modules/role/checkrole.py Here is my code in db.py role=local_import('role') db=SQLDB('mysql://root:test...@localhost/web') db.define_table('address',Field('name'),Field('address')) db.address.name.requires=IS_NOT_EMPTY() db.a

Re: [web2py] How to create a module

2010-12-08 Thread Bruno Rocha
You have to put your module in /web2py/app/modules and use local_import http://web2py.com/book/default/chapter/04?search=local_import from book: Third Party Modules import local_import web2py is written in Python, so it can import and use any Python module, including third party modules. It j

[web2py] How to create a module

2010-12-08 Thread Vikram
Hi I am a newbie for web2py and migrated to python from php. I want to create my own role based simple authentication system using python decorators in web2py. When I create a folder myrole and import the package in db.py (from myrole import *). Web2py throwing exception Traceback (most recent ca

[web2py] Re: web2py themes - feeling nostalgic?

2010-12-08 Thread John Kim
Thanks~ Comparing these different themes, I found a bug in the current 1.89.5 theme: The default view shows four buttons: admin, request, session, and response. The last three buttons should expand to show some useful information. However, the information has a CSS visibility: hidden; property so

Re: [web2py] Re: Interesting fights

2010-12-08 Thread Bruno Rocha
This remembers me the 3 stages of truth: All truth passes through three stages. First, it is *ridiculed*. Second, it > is *violently opposed*. Third, it is *accepted as being self-evident*. Arthur Schopenhauer * German philosopher (178

[web2py] Re: Changing links on SQLTABLE

2010-12-08 Thread mdipierro
Other options: 1) db.table.field.represent=lambda row='row': ... if field.represent.func_defaults[0]=='row': ... 2) db.table.field.represent=lambda row={}: ... if isinstance(field.represent.func_defaults[0],dict): ... 3) if field.represent.func_code.co_varnames[0]=='row': ... this is

Re: [web2py] Re: Changing links on SQLTABLE

2010-12-08 Thread Bruno Rocha
I am overriding SQLTABLE class, here is my idea, let me know if this is a stupid idea :P I want to pass to SQLTABLE a represent_dictionary which I call 'rd', so if I have a table: db.define_table('person', Field('name'), Field('city'),

[web2py] Re: Can any help me with SQLFORM.factory?

2010-12-08 Thread drayco
Now, The problem is only with this function db.define_table("notas", audit, Field("store_id",db.stores, default=store.store_id, writable=False, label='Sucursal',comment='A la que se encuentra asignado'), Field('nota', 'integer', default=None, writable=False,label='No.Nota(Sistema)',com

[web2py] Re: Interesting fights

2010-12-08 Thread Anthony
To put things in perspective, even this is getting some downvotes on reddit: http://www.reddit.com/r/Python/comments/eihkb/web2py_application_exhibition_version_20/ On Monday, December 6, 2010 8:27:41 PM UTC-5, Anthony wrote: > > On Dec 6, 7:51 pm, Branko Vukelic wrote: > >> Oooh, someone's goi

[web2py] Re: new dal

2010-12-08 Thread mdipierro
Your fix is in trunk. Please check it. On Dec 8, 11:26 pm, Brian M wrote: > Massimo, executesql() isn't working correctly with the new DAL in > trunk. The fix looks to be easy, simply replace self._cursor with > self._adaptor.cursor this fixes things for SQLite and I would assume > the other DBs

[web2py] Re: new dal

2010-12-08 Thread Brian M
Massimo, executesql() isn't working correctly with the new DAL in trunk. The fix looks to be easy, simply replace self._cursor with self._adaptor.cursor this fixes things for SQLite and I would assume the other DBs as well - I can try testing MS SQL tomorrow. Fixed code is below, should be right a

[web2py] Re: Changing links on SQLTABLE

2010-12-08 Thread mdipierro
Sorry. Cannot be done this way. Represent takes the field value, not the entire row. The reason is that when web2py tries to represent a field in a SQLTABLE or in a FORM, only that field is guaranteed to be there. the other fields may not have been fetched from the database. Anyway... I will think

[web2py] Re: Can any help me with SQLFORM.factory?

2010-12-08 Thread drayco
Ok, it's work's now, I reset my instance and all work well Thank's On Dec 8, 10:43 pm, drayco wrote: > :D, well only for this function "realizar_venta", because other > crud.create works well > > On Dec 8, 10:35 pm, drayco wrote: > > > :D wel olny crud.create doesn't work > > > this is the trac

[web2py] Re: Can any help me with SQLFORM.factory?

2010-12-08 Thread mdipierro
Can you show me the definition of table nota and its validators? The problem seems to be with one of the validators. On Dec 8, 10:35 pm, drayco wrote: > :D wel olny crud.create doesn't work > > this is the track > > Traceback (most recent call last): >   File "/home/drayco/web2py/gluon/restricted

[web2py] Re: Can any help me with SQLFORM.factory?

2010-12-08 Thread drayco
:D, well only for this function "realizar_venta", because other crud.create works well On Dec 8, 10:35 pm, drayco wrote: > :D wel olny crud.create doesn't work > > this is the track > > Traceback (most recent call last): >   File "/home/drayco/web2py/gluon/restricted.py", line 188, in > restricte

[web2py] Re: Can any help me with SQLFORM.factory?

2010-12-08 Thread drayco
:D wel olny crud.create doesn't work this is the track Traceback (most recent call last): File "/home/drayco/web2py/gluon/restricted.py", line 188, in restricted exec ccode in environment File "/home/drayco/web2py/applications/opticaluz/controllers/ ventas.py", line 1086, in File "/hom

[web2py] Re: Can any help me with SQLFORM.factory?

2010-12-08 Thread drayco
Hi, I updated trunk version, but error still happens, but now all my functions that use crud.(search,read,create) doesn't work this the track Traceback (most recent call last): File "/home/drayco/web2py/gluon/restricted.py", line 188, in restricted exec ccode in environment File "/home/dr

[web2py] Re: Changing links on SQLTABLE

2010-12-08 Thread Bruno Rocha
I Know this is an VERY OLD post, but I was searching the group and I now have the same need as weheh in this thread. db.define_table('person', Field('name'), Field('city'), Field('state'), Field('email',represent: lambda row: A(_href=URL('changemail',vars=dict(person_id=row.id ) But, lambda

[web2py] Re: Can any help me with SQLFORM.factory?

2010-12-08 Thread mdipierro
Thanks for your tests. One more time please. On Dec 8, 9:37 pm, drayco wrote: > Hi, I updated trunk version, but error still happens > > this the track > > Traceback (most recent call last): >   File "/home/drayco/web2py/gluon/restricted.py", line 188, in > restricted >     exec ccode in environm

Re: [web2py] Re: How to pass table labels to SQLTABLE headers param?

2010-12-08 Thread Bruno Rocha
I Just tested this with Inner Joins and Left Outer Joins, works ok. 2010/12/9 mdipierro > This is now partially in trunk but default has not changed. What if > you are printing the result of a join? > > On Dec 8, 7:40 pm, Bruno Rocha wrote: > > Now this is better and I can make a patch, > > > >

[web2py] Re: Can any help me with SQLFORM.factory?

2010-12-08 Thread drayco
Hi, I updated trunk version, but error still happens this the track Traceback (most recent call last): File "/home/drayco/web2py/gluon/restricted.py", line 188, in restricted exec ccode in environment File "/home/drayco/web2py/applications/opticaluz/controllers/ gerencia.py", line 1417, i

[web2py] Re: Can any help me with crud.search?

2010-12-08 Thread drayco
Ups, my bad I tested on web2py version 1.89.5 and trunk On Dec 8, 5:56 pm, drayco wrote: > Hi > > I have this code in the model: > > db36.define_table('benefs2', >     #Field('id','integer'), >     Field('unique_id','string', writable=False, readable=False), >     Field('active','string', writab

[web2py] Re: Can any help me with crud.archive?

2010-12-08 Thread drayco
Ups, my bad I tested on web2py version 1.89.5 and trunk On Dec 8, 7:58 pm, mdipierro wrote: > which web2py version? > > On Dec 8, 6:30 pm, drayco wrote: > > > Hi > > > I have this in model > > > #audit field group > > audit = db.Table(db,'audit', > >     Field('unique_id', 'string',default=uuid

[web2py] needs more new dal testers

2010-12-08 Thread mdipierro
Can you try jython and pypy and do jython dal.py pypy dal.py Please report any error. Massimo

[web2py] Re: Can any help me with SQLFORM.factory?

2010-12-08 Thread mdipierro
I think this is now fixed. Please give it a try. On Dec 8, 6:42 pm, drayco wrote: > Hi this the code in the controller: > > def form_factory(*a): >     return SQLFORM(SQLDB(None).define_table(*a)) > > def ventas(): >     form=form_factory('myform', > > SQLField('inicio','date',default=request.now

Re: [web2py] Re: How to pass table labels to SQLTABLE headers param?

2010-12-08 Thread Bruno Rocha
Nice! GoogleCode has Code Reviews \o/ http://code.google.com/p/web2py/source/detail?r=e0f294a838b80a240e6bec0ddfc8f6ab6764cae5 I note you changed this a little, my question: if field has no label > defined? this field.label will be filled up with fieldname? > > > headers = {} > for c in colu

[web2py] Re: creation of testing database

2010-12-08 Thread Anthony
On Dec 8, 9:58 pm, Anthony wrote: > According to the book, it only tries the second db if the first fails. > You can also do random, round-robin, or controller/action dependent > connections if desired. In case anyone is reading this in the old plain text Google Groups interface, here are the two

Re: [web2py] Re: creation of testing database

2010-12-08 Thread Anthony
According to the book, it only tries the second db if the first fails. You can also do random, round-robin, or controller/action dependent connections if desired. On Wednesday, December 8, 2010 9:45:07 PM UTC-5, Bruno Rocha wrote: web2py will stop at the first it can connect? or it will try the s

Re: [web2py] Re: creation of testing database

2010-12-08 Thread Bruno Rocha
web2py will stop at the first it can connect? or it will try the second even if connected succesfully with the first? I am asking that because my localhost has access to my remote db, so if my list is ['remotedb','localdb'], I will always connect with the first even working locally. 2010/12/9 mdi

Re: [web2py] Re: How to pass table labels to SQLTABLE headers param?

2010-12-08 Thread Bruno Rocha
I note you changed this a little, my question: if field has no label defined? this field.label will be filled up with fieldname? headers = {} for c in columns: (t,f) = c.split('.') field = sqlrows.db[t][f] headers[c] = field.label headers = {} for c in c

[web2py] Re: creation of testing database

2010-12-08 Thread mdipierro
+1 Mind that the uri can also be a list DAL([uri1,uri2,uri3]) and web2py will try them all. This is designed for replicated databases. On Dec 8, 7:50 pm, Bruno Rocha wrote: > I always use: > > if request.env.server_name=='rochacbruno.local' or > request.env.http_host.split(':')[0]=='127.0.0.1'

[web2py] Re: creation of testing database

2010-12-08 Thread mdipierro
+1 On Dec 8, 7:50 pm, Bruno Rocha wrote: > I always use: > > if request.env.server_name=='rochacbruno.local' or > request.env.http_host.split(':')[0]=='127.0.0.1': >     db=DAL() > else: >     db=DAL() > > This is useful because I transfer my files by sftp or ssh, and I dont need > to change the

[web2py] Re: How to pass table labels to SQLTABLE headers param?

2010-12-08 Thread mdipierro
This is now partially in trunk but default has not changed. What if you are printing the result of a join? On Dec 8, 7:40 pm, Bruno Rocha wrote: > Now this is better and I can make a patch, > > Do you think SQLTABLE should use the defined field labels by default if > headers param is empty? > >

Re: [web2py] Re: Contributions

2010-12-08 Thread Bruno Rocha
A Simple 'donate' paypal buttom, should gave attention from more people for donate. not everyone understant that chipin stuff. 2010/12/9 Bruno Rocha > CSS error > > Just need to remove the 'height' attributes from and puts > 'height:100%' to the div style. > > > > > http://widget.chipin.c

Re: [web2py] Re: Contributions

2010-12-08 Thread Bruno Rocha
CSS error Just need to remove the 'height' attributes from and puts 'height:100%' to the div style. http://widget.chipin.com/widget/id/3fd524816850020c"; name="movie">http://widget.chipin.com/widget/id/3fd524816850020c";> Anyway + 1 for including a simple paypal 'donate' buttom.

[web2py] Re: Can any help me with SQLFORM.factory?

2010-12-08 Thread mdipierro
This is a bug in the new DAL. For now in production, please use stable web2py. Anyway, this will be fixed soon. On Dec 8, 6:42 pm, drayco wrote: > Hi this the code in the controller: > > def form_factory(*a): >     return SQLFORM(SQLDB(None).define_table(*a)) > > def ventas(): >     form=form_fac

[web2py] Re: Can any help me with crud.archive?

2010-12-08 Thread mdipierro
which web2py version? On Dec 8, 6:30 pm, drayco wrote: > Hi > > I have this in model > > #audit field group > audit = db.Table(db,'audit', >     Field('unique_id', 'string',default=uuid.uuid4(), writable=False, > readable=False), >     Field('active', 'boolean', default=True, writable=False, > re

[web2py] Re: GAE issue with !=

2010-12-08 Thread mdipierro
Please give it one more try. On Dec 8, 5:42 pm, howesc wrote: > actually, not the same issue, different error, same line. :(

[web2py] Re: Contributions

2010-12-08 Thread Anthony
On Wednesday, December 8, 2010 7:31:53 PM UTC-5, ron_m wrote: The web2py.com home page contributions widget is partially covered to the point nothing can be pushed to make a contribution. I am using Firefox on Ubuntu 10.04 For me it depends on the zoom level of the browser window. Looks fine at 10

Re: [web2py] Re: creation of testing database

2010-12-08 Thread Bruno Rocha
I always use: if request.env.server_name=='rochacbruno.local' or request.env.http_host.split(':')[0]=='127.0.0.1': db=DAL() else: db=DAL() This is useful because I transfer my files by sftp or ssh, and I dont need to change the db everytime. 2010/12/8 mdipierro > If you just have > >

[web2py] Re: How to pass table labels to SQLTABLE headers param?

2010-12-08 Thread villas
> Do you think SQLTABLE should use the defined field labels by default if > headers param is empty? +1

Re: [web2py] Re: How to pass table labels to SQLTABLE headers param?

2010-12-08 Thread Bruno Rocha
Now this is better and I can make a patch, Do you think SQLTABLE should use the defined field labels by default if headers param is empty? if not columns: columns = sqlrows.colnames if headers=='fieldname:capitalize': headers = {} for c in col

[web2py] Re: orderby='' on Google App Engine

2010-12-08 Thread Richard
ah OK. Anyway, how could this be done server-side when also using limit? I want to show some random records without querying all the data.

[web2py] Can any help me with SQLFORM.factory?

2010-12-08 Thread drayco
Hi this the code in the controller: def form_factory(*a): return SQLFORM(SQLDB(None).define_table(*a)) def ventas(): form=form_factory('myform', SQLField('inicio','date',default=request.now.date(),requires=IS_NOT_EMPTY()), SQLField('fin','date',default=request.now.date())) t

Re: [web2py] Re: creation of testing database

2010-12-08 Thread Albert Abril
This solution is as simple as awesome. :) I remembered when I studied the three sides of RubyOnRails: production, testing and development, that (as a newbie) freaked me out a little. If I'm not wrong, they have it because to change the database is not easy as change the connection database string.

[web2py] Contributions

2010-12-08 Thread ron_m
The web2py.com home page contributions widget is partially covered to the point nothing can be pushed to make a contribution. I am using Firefox on Ubuntu 10.04 Ron

[web2py] Can any help me with crud.archive?

2010-12-08 Thread drayco
Hi I have this in model #audit field group audit = db.Table(db,'audit', Field('unique_id', 'string',default=uuid.uuid4(), writable=False, readable=False), Field('active', 'boolean', default=True, writable=False, readable=False, label='Activo',comment='Desactiva para eliminar este registro

[web2py] Can any help me with crud.search?

2010-12-08 Thread drayco
Hi I have this code in the model: db36.define_table('benefs2', #Field('id','integer'), Field('unique_id','string', writable=False, readable=False), Field('active','string', writable=False, readable=False), Field('creadoEl','datetime', writable=False, readable=False), Field('cr

[web2py] Re: GAE issue with !=

2010-12-08 Thread howesc
actually, not the same issue, different error, same line. :(

[web2py] Re: GAE issue with !=

2010-12-08 Thread howesc
hmm, same issue: ERROR 2010-12-08 23:38:06,535 restricted.py:151] Traceback (most recent call last): File "/home/cfhowes/tools/web2py_src/web2py/gluon/restricted.py", line 188, in restricted exec ccode in environment File "/home/cfhowes/tools/web2py_src/web2py/applications/pump/controllers/defaul

[web2py] Re: GAE issue with !=

2010-12-08 Thread mdipierro
Please try again. You do not need to copy dal.py over sql.py. As of yesterday they are the same in trunk. Massimo On Dec 8, 4:13 pm, howesc wrote: > i just pulled from trunk, copied dal.py to sql.py, and did not get past > logging in to my app to test for you. i got this error: > > ERROR 2010-12

[web2py] Re: creation of testing database

2010-12-08 Thread Vidul
Great, thank you Massimo! On Dec 8, 8:22 pm, mdipierro wrote: > If you just have > > production=True > if production: >    db=DAL('sqlite://production.sqlite') > else: >    db=DAL('sqlite://test.sqlite') > > when you switch to production=False, it will recreate the missing > tables in test.sqlit

[web2py] Re: crud.update question

2010-12-08 Thread Kuba Kucharski
nevermind. my problem was dbio=False in the wrong place.

[web2py] Re: GAE issue with !=

2010-12-08 Thread howesc
i just pulled from trunk, copied dal.py to sql.py, and did not get past logging in to my app to test for you. i got this error: ERROR 2010-12-08 22:09:31,819 restricted.py:151] Traceback (most recent call last): File "/home/cfhowes/tools/web2py_src/web2py/gluon/restricted.py", line 188, in restric

[web2py] Re: couchdb anybody?

2010-12-08 Thread mdipierro
Because the integration is not completed. Close but not done. On Dec 8, 2:44 pm, António Ramos wrote: > For dummies why not a video tutorial on using couchdb with web2py? > I would help a lot for newcommers and for web2py in general! > > Best regards > António > > 2010/12/8 mdipierro > > > Plea

[web2py] Re: new google groups

2010-12-08 Thread Anthony
Cool. In addition to rich text formatting (with hyperlinks and images), we can also attach files now.

[web2py] Re: zoho ?

2010-12-08 Thread apple
Hi, I evaluated the ZOHO CRM. It is very configurable and a good free tool for small business. However it is a 100% hosted database. The API (certainly on the free version) has limits on the number of transactions and number of records that can be retrieved. Also it is quite inflexible e.g. you ca

Re: [web2py] Re: couchdb anybody?

2010-12-08 Thread António Ramos
For dummies why not a video tutorial on using couchdb with web2py? I would help a lot for newcommers and for web2py in general! Best regards António 2010/12/8 mdipierro > Please make sure you have the latest sql.py from trunk. > CouchDB should call the rollback at 2325 not the one at line 988.

[web2py] Re: couchdb anybody?

2010-12-08 Thread mdipierro
Please make sure you have the latest sql.py from trunk. CouchDB should call the rollback at 2325 not the one at line 988. Massimo On Dec 8, 1:57 pm, David Marko wrote: > I tried it but getting following error: > > Traceback (most recent call last): > File "c:\java\web2py\gluon\main.py", line 488

Re: [web2py] Re: select issue

2010-12-08 Thread Richard Vézina
I'm sorry for the inconvenience, I made a mistake in my field for my term "valid" criterion was antagonistic to the selection I was trying to do... [?] Richard It should wrote : db((db['table1'].verified == None) & (db['table1'].valid == None) | (db['table1'].verified == False) & (db['table1'].

[web2py] Re: couchdb anybody?

2010-12-08 Thread David Marko
I tried it but getting following error: Traceback (most recent call last): File "c:\java\web2py\gluon\main.py", line 488, in wsgibase BaseAdapter.close_all_instances(BaseAdapter.rollback) File "c:\java\web2py\gluon\sql.py", line 264, in close_all_instances action(instance) File "c:\java\web2py\

[web2py] Re: select issue

2010-12-08 Thread Brian M
I suspect that you need some extra () in there to correctly group your AND and OR. Maybe try the below version db(((db['table1'].verified == None) & (db['table1'].data_grade == 'grade1') & (db['table1'].valid != False)) | ((db['table1'].verified == False) & (db['table1'].data_grade == 'grade1') &

Re: [web2py] Web2py Application Exhibition 2.0

2010-12-08 Thread Mr admin
Martin, GREAT! I voted for your sample app and I love the fact that it won't let me vote twice. The only thing I woud change so far is this. Change You already vote this one to this You have already voted for this one -- 1 vote per person Looks GREAT! Thanks Martin Mr.NetAdmin O

[web2py] select issue

2010-12-08 Thread Richard Vézina
Hello, At the DB level this request return results... SELECT id FROM table1 WHERE verified IS NULL and data_grade = 'grade1' and valid IS NOT FALSE or verified IS FALSE and data_grade = 'grade1' and valid IS NOT FALSE In web2py with equivalent : db((db['table1'].verified == None) & (db['table1

[web2py] new google groups

2010-12-08 Thread Bruno Rocha
Google groups has changed! https://groups.google.com/forum/#overview https://groups.google.com/forum/#forum/web2py very nice! -- Bruno Rocha http://about.me/rochacbruno/bio

[web2py] Web2py Application Exhibition 2.0

2010-12-08 Thread Martin.Mulone
You can start submitting your application http://w2pexhibition.appspot.com/ You can vote many applications you want only one time (you can unvote). The most voted application won. I made an example and there is link with the source code in the site. I'm only made the app, Mr. Netadmin is in charg

[web2py] Re: creation of testing database

2010-12-08 Thread mdipierro
If you just have production=True if production: db=DAL('sqlite://production.sqlite') else: db=DAL('sqlite://test.sqlite') when you switch to production=False, it will recreate the missing tables in test.sqlite. On Dec 8, 8:10 am, Vidul wrote: > I'd like to create a testing database which

[web2py] zoho ?

2010-12-08 Thread Carlos
Hi, Has anyone used zoho products?. Has anyone integrated with zoho from web2py?. http://www.zoho.com I could be in a position where I have to offer a solution to a client that could potentially be done by zoho, or start it from scratch with web2py. Note that I don't have any experience with z

[web2py] crud.update question

2010-12-08 Thread Kuba Kucharski
I have form=crud.update(db.table,id) and then in the view {{=form.custom.begin}} {{form.custom.widget.name}} {{=form.custom.widget.logo}} {{=form.custom.widget.twitter_link}} {{=form.custom.submit}} {{=form.custom.end}} but this way the form is not getting populated, also values that I ommit i

Re: [web2py] Re: orderby='' on Google App Engine

2010-12-08 Thread Albert Abril
Massimo is correct, I just wanted to know the more efficient way to randomize a Rows dictionary, instead of using orderby=. Because as said on the book, orderby= is not supported on GAE. Just easy as using python random library :) Thanks again. On Wed, Dec 8, 2010 at 1:04 AM, mdipierro wrote:

[web2py] Re: new dal

2010-12-08 Thread mdipierro
fixed Thanks. On Dec 8, 9:02 am, ron_m wrote: > I pulled latest version from trunk and tested my app using MySQL and > got a ticket. Easy fix > > In sql.py change line 1403 pymysqldb should be pymysql to match the > name from the import > >         self.pool_connection(lambda db=db, >          

[web2py] Re: NameError: name 'db' is not defined.

2010-12-08 Thread mdipierro
Is opdateerxartikels a model? If so, it cannot be imported, it must be executed. Instead of from opdateerxartikels import * do execfile('opdateerxartikels.py') On Dec 8, 3:16 am, Johann Spies wrote: > On 8 December 2010 11:08, mdipierro wrote: > > > How do you start iPython? > > python web2p

[web2py] Re: new dal

2010-12-08 Thread ron_m
I pulled latest version from trunk and tested my app using MySQL and got a ticket. Easy fix In sql.py change line 1403 pymysqldb should be pymysql to match the name from the import self.pool_connection(lambda db=db, user=credential_decoder(user),

[web2py] Re: new dal

2010-12-08 Thread ron_m
This is very interesting. I believe this would change the GPL license reach for MySQL. The regular Python driver is a wrapper around the C MySQL client library so as a user of that driver you have embedded a part of MySQL into your application. Using the pure Python driver means you are now using w

[web2py] creation of testing database

2010-12-08 Thread Vidul
I'd like to create a testing database which contains the same tables as the production one. This is the code I came up with: for i in db_test.tables: db_test[i].drop() db_test.commit() for i in db.tables: db_test.define_table(i, db[i]) db_test.commit() Is there a better way? Thank you f

[web2py] Re: ajax search "select" field using crud or sqlform

2010-12-08 Thread Ole Martin Maeland
I have found a solution on it. steps: 1. create a view in the db - usin union selects 2. create a fake db - migrate = False 3. use the SQLFORM autocomplete as normal, ref the fake db. the fake db have to be set up before the db were the autocomplete widget is used. that's it. I have found a w

Re: [web2py] Re: NameError: name 'db' is not defined.

2010-12-08 Thread Johann Spies
On 8 December 2010 11:08, mdipierro wrote: > How do you start iPython? > python web2py.py -M -S kb Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything we need for life and godliness thr

[web2py] Re: NameError: name 'db' is not defined.

2010-12-08 Thread mdipierro
How do you start iPython? On Dec 8, 2:22 am, Johann Spies wrote: > I want to run code in the shell, so I wrote two functions and imported it. > The following happens: > > In [1]: from opdateerxartikels import * > --- > NameEr

[web2py] NameError: name 'db' is not defined.

2010-12-08 Thread Johann Spies
I want to run code in the shell, so I wrote two functions and imported it. The following happens: In [1]: from opdateerxartikels import * --- NameError Traceback (most recent call last) /home/