[web2py] Re: Is anyone using MongoDB with web2py?

2010-05-09 Thread rfx_labs
Hi David, I think the problem is that modules and controllers are executed on every page call. The web2py DAL open AND close a new connection to the DB on ever page call. Maybe you shut do the same for mongo too. >>> connection = Connection() do your stuff >>> connection.disconnect() Martin On

[web2py] Re: Web2Py Book application

2010-03-28 Thread rfx_labs
Hi Massimo any news on the (potential) release date? On 3 Mrz., 17:57, mdipierro wrote: > I will post it but I want to clean it up first. It was written a bit > in a hurry. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group

[web2py] Re: Running DAL oustide web2py

2010-03-29 Thread rfx_labs
Hi Giovanni, I had the same problem and here is my simple solution: model.py: from gluon.dal import DAL, Field db = DAL("sqlite://storage.db") db.define_table("reference", Field("name", "string", notnull=True), Field("L", "double"), Field("a", "double"),

[web2py:28180] Bug: rows.response is no longer a list

2009-08-07 Thread rfx_labs
Hi, rows.response is now SQLite3.row but shut be list: Manual Page 146: Notice that an SQLRows object is a container for: 1 rows.colnames 2 rows.response colnames is a list of the column names returned by the raw select. response is a list of tuples which containes the raw response of select, be

[web2py:28206] Re: Bug: rows.response is no longer a list

2009-08-08 Thread rfx_labs
On 8 Aug., 09:14, mdipierro wrote: > Sorry, reverting the patch in trunk. I will make that optional. THX everything is fine again. Martin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To po

[web2py:34384] Where is Rows.response gone?

2009-11-02 Thread rfx_labs
Hi Massimo, many of my apps use code like this: result = db().select(db.reference.id, db.reference.l, db.reference.a, db.reference.b) for i, l, a, b in result.response: c.reference(("lab"), l, a, b) With code from Trunk 1376 this is broken. How do I get the same result now? Regards Martin

[web2py:34395] Re: Where is Rows.response gone?

2009-11-02 Thread rfx_labs
Hi Massimo, > because developers are not supposed to use Rows.response which is an internal > variable Maybe I have misunderstand something in the first version of your book on site 146. > What were you using response for? Mainly to get custom dictionaries. > If you post an example, I can help

[web2py:36269] SVN 1472: sql.py error

2009-12-01 Thread rfx_labs
Hi Massimo, with version 1472 a bug in sql.py is introduced: File "/Applications/cherokee.app/Contents/MacOS/web2py/gluon/ sql.py", line 1234, in define_table t = self[tablename] = Table(self, tablename, *fields) File "/Applications/cherokee.app/Contents/MacOS/web2py/gluon/ sql.py", line

[web2py:36336] Re: SVN 1472: sql.py error

2009-12-02 Thread rfx_labs
On 2 Dez., 07:04, mdipierro wrote: > fixed in trunk. Can you please check again? Everything works well again. THX Martin -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsub

[web2py:37135] Substring in new DAL

2009-12-13 Thread rfx_labs
Hi Massimo, this doesn't work any more: nw.ekartikel.Name[4:] File "/PATH/web2py/gluon/sql.py", line 2742, in __getslice__ s = self._db._adapter.SUBSTRING(d) TypeError: SUBSTRING() takes exactly 4 arguments (2 given) Martin -- You received this message because you are subscribed to the

[web2py:37136] Re: Substring in new DAL

2009-12-13 Thread rfx_labs
this is the patch for this: @@ -151,7 +151,7 @@ return 'Random()' def NOT_NULL(self,default): return 'NOT NULL DEFAULT %s' % default -def SUBSTRING(self,fieldname,pos,lenght): +def SUBSTRING(self,fieldname,pos,length): return 'SUBSTR(%s,%s,%s)' % (fieldname,

[web2py] Bug in trunk: __getslice__

2010-01-12 Thread rfx_labs
gluon/sql.py", line 2716, in __getslice__ d = dict(field=str(self), pos=pos0+1, length=length) TypeError: cannot concatenate 'str' and 'int' objects Fix: d = dict(field=str(self), pos=str(int(pos0)+1), length=length) But this is ugly maybe a refactor of this methode is nessarry. Martin --

[web2py] Selfreference and IS_IN_DB Pulldown

2010-01-14 Thread rfx_labs
Hi All, I have 2 tables in an one2many relation. Table "config" has a selfreference. approval.define_table("config", SQLField("name", "string", notnull=True), SQLField("parent", 'reference config')) approval.define_table("recipe", SQLField("name", "string", n

[web2py:13134] Substring in SQL query

2008-12-08 Thread rfx_labs
Hi, I have to order queries by a part of the string. In MySQL this looks like "SELECT * FROM table ORDER BY SUBSTRING(table.field, 4,3)" and after a patch of sql.py "db().select(db.table.ALL, orderby=db.table.field[3:3])" I could test this only with MySQL and Sqlite. The code is already at Mas

[web2py:13139] Re: Substring in SQL query

2008-12-08 Thread rfx_labs
Hi Denes, > > "db().select(db.table.ALL, orderby=db.table.field[3:3])" > > as in: > db().select(db.table.ALL, orderby=db.table.field[3:6]) Good aspect, the second value shut be the end position and not the length of returned string. As long as all Values are > 0 is this no problem. but the val

[web2py:14193] Helper for Custom Forms

2008-12-28 Thread rfx_labs
Some treads here disus the handling of custom forms. One hint was use SQLFORM in the controller and build anything else in the view. I don't like the idea to do things twice. Another hint was {{=form[0][1][1][0]}}. Not so handy and may break when fields are added to the table. So i wrapped this

[web2py:14215] Re: Helper for Custom Forms

2008-12-28 Thread rfx_labs
Hi Massimo, > This is not equivalent to your patch but it will make your simpler. I have tried your modifikation. it does all what i need, without any magic anymore , that's great. > Hope it is acceptable. For me it is, hopefully this helps other too ;-) Martin --~--~-~--~~

[web2py:14225] Re: Helper for Custom Forms

2008-12-28 Thread rfx_labs
Jon, > If you use this successfully to build custom form(s) can you post a > sample of your controller and view here? Model: proof=SQLDB("sqlite://proof.db") proof.define_table('match', SQLField('name'), SQLField('min', 'integer'),

[web2py:14236] Re: Helper for Custom Forms

2008-12-29 Thread rfx_labs
Hi Jon, > form.element(_name="reference").update(_type="hidden") I'am sorry. I've copied the example from a real application. But simplfy the model, and forget to adjust the name of deleted field reference in the view. >'returns: is the rendert output of the view ,-) Martin --~--~-~--

[web2py:15826] Re: wsgi webfaction how-to

2009-02-03 Thread rfx_labs
> yes, and it appears to be working fine; you are welcome to click on > the following link, though it is currently just the standard welcome/ hello dhmorgan, I've followed your instructions and welcome works fine. But if I access admin: "admin disabled because unable to access password file" Th