Bugs item #1374599, was opened at 2005-12-06 19:34
Message generated for change (Comment added) made by phd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1374599&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SQLite
Group: SQLObject release (specify)
>Status: Closed
Resolution: None
Priority: 5
Submitted By: dvd (dvd-00)
Assigned to: Nobody/Anonymous (nobody)
Summary: no such column with 0.7.0
Initial Comment:
I'm tring SQLObject (v 0.7.0 easy-install)
this is my first try:
****************************************************
import sqlobject as _s
class Projects(_s.SQLObject):
project = _s.StringCol()
flags = _s.MultipleJoin('ProjectFlags')
sources = _s.MultipleJoin('ProjectSources')
@staticmethod
def newProject(pjname, **kwd):
x = Projects(project=pjname)
for name, value in kwd.items():
ProjectFlags(project=x, name=name, value=value)
return x
class ProjectFlags(_s.SQLObject):
project = _s.ForeignKey('Projects')
name = _s.StringCol()
value = _s.StringCol()
import os.path
db_filename = os.path.abspath('xxx.db')
connection = _s.connectionForURI("sqlite:/:memory:")
_s.sqlhub.processConnection = connection
Projects.createTable()
ProjectFlags.createTable()
Projects.newProject("project01", fiter="*.tiff",
max_iso=4700)
p = Projects.get(1)
print p
print p.flags
****************************************************
the last line raise:
pysqlite2.dbapi2.OperationalError: no such column:
projects_id
all works fine if I change the ProjectFlags attribute
"project" in "projects"
Is this the normal behavior?
----------------------------------------------------------------------
>Comment By: Oleg Broytmann (phd)
Date: 2006-01-03 16:26
Message:
Logged In: YES
user_id=4799
It is normal. Either write
projects = _s.ForeignKey('Projects')
or
flags = _s.MultipleJoin('ProjectFlags', joinColumn="project_id")
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1374599&group_id=74338
|