I have a table called pics and a table called picnotes, where the 
definitions are like

db.define_table("pics", Field(...))
db.define_table("picnotes", Field("about", 'reference pics', Field("note", 
"string"))

And I want to extract all rows of pics that have a note referring to them 
(this is a simplified version of what I really want).  I'm trying to follow 
the book, and double-checking with posts in this group (and peeking at the 
p4web group), but I keep getting the error

<class 'sqlite3.OperationalError'> near "<": syntax error

where the traceback goes to

File 
"C:\Users\Dave\web2py_src\web2py_src-2.22.5\web2py\gluon\packages\dal\pydal\adapters\base.py",
 
line 468, in execute
rv = self.cursor.execute(command, *args[1:], **kwargs)

and the variables in that frame include

command    'SELECT "badpic"."id", "badpic"."iurl", "badpic"....ND <Set 
("badpic"."id" = "badpicnote"."about")>);'
args    ('SELECT "badpic"."id", "badpic"."iurl", "badpic"....ND <Set 
("badpic"."id" = "badpicnote"."about")>);',)

I've tried

vrows = db(db.pics.id == db.picnotes.about).select(db.pics.ALL)

and

vrows = db(db.pics.id == db.picnotes.about).select(db.pics.on(db.pics.id == 
db.picnotes.about))

What do I need to do instead?

version stuff:


web2py™
Version 2.22.5-stable+timestamp.2022.06.04.18.13.51
Python
Python 3.10.7: 
C:\Users\Dave\AppData\Local\Programs\Python\Python310\python.exe (prefix: 
C:\Users\Dave\AppData\Local\Programs\Python\Python310)


Thanks.

/dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/1f603602-6156-4025-aa96-f5b01625362cn%40googlegroups.com.

Reply via email to