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
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
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"),
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
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
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
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
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
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
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
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,
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
--
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
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
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
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
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
--~--~-~--~~
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'),
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
--~--~-~--
> 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
20 matches
Mail list logo