More DAL testing...
It is interesting, in that the first time the dal.py code is executed
everything works just fine, however on the very next request I receive
this trackback.
http://paste.pocoo.org/show/214476/
sql.py works just fine for many requests.
I am obviously using the dal in an envir
First of all thank you for your through tests into the DAL.
I worked into this specific issue and I fixed the discrepancy. It
deserves an explanation anyway. Here is a minimal example to reproduce
the problem:
code
db.define_table('b', Field('b'))
db.define_table('c', Field('d'))
print db()
will look into this.
On Apr 9, 2:14 pm, Thadeus Burgess wrote:
> I do give it a name.
> In this case the name is 'current_R'.
>
> I just typed the line of code that caused the error to help you narrow
> it down, I am sorry I did not copy/paste instead of quickly typing it.
> The code is correct,
I do give it a name.
In this case the name is 'current_R'.
I just typed the line of code that caused the error to help you narrow
it down, I am sorry I did not copy/paste instead of quickly typing it.
The code is correct, I don't edit anything when I test it on dal.py
By the way, the trackback s
This
>db.table.field.sum().with_alias()
is invalid syntax. You need to give it a name
db.table.field.sum().with_alias('thesum')
On Apr 9, 1:43 pm, Thadeus Burgess wrote:
> db.table.field.sum().with_alias()
>
> Traceback (most recent call last):
> File "/home/tburgess/Applications/web2py/gluo
db.table.field.sum().with_alias()
Traceback (most recent call last):
File "/home/tburgess/Applications/web2py/gluon/restricted.py", line
173, in restricted
exec ccode in environment
File
"/home/tburgess/Applications/web2py/applications/pms/controllers/default.py",
line 305, in
File "/h
Agreed. Lets narrow this down, I will see if I can replicate the issue
on a smaller scale.
-Thadeus
On Wed, Apr 7, 2010 at 11:08 PM, Massimo Di Pierro
wrote:
> I guess my question is " why does it not throw an exception in sql.py?" It
> should since
>
>>> db.dog.owner.represent = lambda valu
I guess my question is " why does it not throw an exception in
sql.py?" It should since
db.dog.owner.represent = lambda value: "%s" % db.person[value].name
when called with value==None should always result in the error you see
in dal.py.
Can you help me debug this? My problem is not why
I am not using different datasets, or using different queries.
So here we go, let me explain in every minuet detail this process.
>>> cd ~
>>> hg clone https://web2py.googlecode.com/hg web2py
>>> cd web2py
>>> ln -s ~/path/to/my/application applications/pms
>>> python web2py.py -a
*go to 127.0.0
I assume it is
db.dog.owner.represent = lambda value: "%s" % db.person[value].name
The stacktrace you get is because one of your records has owner==None
hence db.person[value] is also None and None has no .name. It is not a
bug. You are doing different queries or using different datasets.
I am defining this function.
db.define_table('person', Field('name'))
db.define_table('dog', Field('nickname'), Field('owner', db.person))
db.dog.owner.represent = lambda value: "%s" % db.owner[value].name
This works in sql.py
This does not work in dal.py
You said you made changes, I tested, w
No.
For dal.py to be accepted it has to work exactly like sql.py
Therefore I cannot make ANY code changes if we want a new DAL.
-Thadeus
On Wed, Apr 7, 2010 at 5:31 PM, mdipierro wrote:
> This
>
> db.TableA.id_TableB.represent = lambda value: "%s" %
> db.TableB[value].name
>
> should be
This
db.TableA.id_TableB.represent = lambda value: "%s" %
db.TableB[value].name
should be
db.TableA.id_TableB.represent = lambda value: (db.TableB[value] or
{}).get('name','anonymous')
On Apr 7, 1:36 pm, Thadeus Burgess wrote:
> Traceback (most recent call last):
> File "/home/tburge
It comes from the line
db.TableB[value].name
-Thadeus
On Wed, Apr 7, 2010 at 3:19 PM, mdipierro wrote:
> need more info
>
> On Apr 7, 1:36 pm, Thadeus Burgess wrote:
>> Traceback (most recent call last):
>> File "/home/tburgess/Applications/web2py/gluon/restricted.py", line
>> 173, in r
need more info
On Apr 7, 1:36 pm, Thadeus Burgess wrote:
> Traceback (most recent call last):
> File "/home/tburgess/Applications/web2py/gluon/restricted.py", line
> 173, in restricted
> exec ccode in environment
> File
> "/home/tburgess/Applications/web2py/applications/pms/views/default
Traceback (most recent call last):
File "/home/tburgess/Applications/web2py/gluon/restricted.py", line
173, in restricted
exec ccode in environment
File
"/home/tburgess/Applications/web2py/applications/pms/views/default/index.html",
line 62, in
File "/home/tburgess/Applications/web
uploading fix. please check it. Thanks for testing this.
On Apr 5, 3:59 pm, Thadeus Burgess wrote:
> Traceback (most recent call last):
> File "/home/tburgess/Applications/web2py/gluon/restricted.py", line
> 173, in restricted
> exec ccode in environment
> File
> "/home/tburgess/Applicat
Traceback (most recent call last):
File "/home/tburgess/Applications/web2py/gluon/restricted.py", line
173, in restricted
exec ccode in environment
File
"/home/tburgess/Applications/web2py/applications/pms/controllers/default.py",
line 278, in
File "/home/tburgess/Applications/web2py/gl
try now
On Apr 5, 2:30 pm, Thadeus Burgess wrote:
> Now I get this for reference field
>
> Traceback (most recent call last):
> File "/home/tburgess/Applications/web2py/gluon/restricted.py", line
> 173, in restricted
> exec ccode in environment
> File
> "/home/tburgess/Applications/web2p
Now I get this for reference field
Traceback (most recent call last):
File "/home/tburgess/Applications/web2py/gluon/restricted.py", line
173, in restricted
exec ccode in environment
File
"/home/tburgess/Applications/web2py/applications/pms/views/default/index.html",
line 84, in
{{=d
I fixed the former. I did not fix the latter. It is a known problem
with the new dal and one of the few things that needs to be ironed
out: it does not like select('fieldname') only
select(db.table['fieldname']). Not difficult to fix anyway.
On Apr 5, 2:13 pm, Thadeus Burgess wrote:
> I get this
21 matches
Mail list logo