class List(SQLObject):
title = UnicodeCol(notNone=True)
user = ForeignKey('User')
items = MultipleJoin('Item')
class User(SQLObject):
email = StringCol(alternateID=True)
lists = MultipleJoin('List')
class Item(SQLObject):
value = UnicodeCol(notNone=True)
list = ForeignKey('List')
Causes Error:
psycopg2.ProgrammingError: relation "list" does not exist
Reordering the classes with cause whichever class is first to receive
this warning.
Per the suggestion at:
http://joe.sl4g.com/words/code/sqlobject_order.html
I added the line:
soClasses = ('List','User','Item')
The class appears to be seen but I get the error:
psycopg2.ProgrammingError: syntax error at or near "user" at character
149
from http://www.sqlobject.org/SQLObject.html#many-to-many-relationships
first example:
>>> class User(SQLObject):
...
... class sqlmeta:
... # user is a reserved word in some databases, so we won't
... # use that for the table name:
... table = "user_table"
...
... username = StringCol(alternateID=True, length=20)
... # We'd probably define more attributes, but we'll leave
... # that exercise to the reader...
...
... roles = RelatedJoin('Role')
So try to avoi using "user" as a fieldname/table name..
[]s
Roger
Title [1 ----- *] Subttile [1 ---- *] "Undertitle"