I finally have time to get into learning TurboGears and I have decided
to make a grade book. I set up my model and it created fine, I used
catwalk to populate it with some data, but I got some odd results in
the catwalk interface so I wonder if I had set up my model correctly or
not.

Anyway, after I had added some records to some tables, decided to
delete the database and start over with a fresh one with minor
modifications to the model. I did a sql drop and got a bunch of
feedback from that command that I did not expect. Now when I do a sql
create with  my modified model, I get this error:
-----------------------------------------------
Laptop-2:~/sites/gradebook jeremy$ tg-admin sql create
Using database URI sqlite:///Users/jeremy/Sites/gradebook/gradebook.db
Exception exceptions.AttributeError: "'pysqlite2.dbapi2.Connection'
object has no attribute 'autocommit'" in <bound method
Transaction.__del__ of <sqlobject.dbconnection.Transaction object at
0x129de50>> ignored
-----------------------------------------------

Here is my model:

===========================
from sqlobject import *
from turbogears.database import PackageHub

hub = PackageHub("gradebook")
__connection__ = hub

class Student(SQLObject):
        firstName = StringCol(length=25, )#alternateID=True)
        middleInitial = StringCol(length=1, default=None)
        lastName = StringCol(length=25, )#alternateID=True)
        studentID = StringCol(length=5,unique=True,alternateID=True)
        courses = RelatedJoin('Course')
        grades = MultipleJoin('Grade')

class Course(SQLObject):
        student = RelatedJoin('Student')
        assignments = RelatedJoin('Assignment')
        courseID = StringCol(length=25,unique=True,alternateID=True)


class Assignment(SQLObject):
        assignmentID = StringCol(length=5,unique=True,alternateID=True)
        points = FloatCol()
        description = StringCol()
        grades = MultipleJoin('Grade')
        course = RelatedJoin('Course')


class Grade(SQLObject):
        student = ForeignKey('Student')
        assignment = ForeignKey('Assignment')
        score = FloatCol()

===========================

I am not sure what the problem is, any help will be appreciated.

Thanks,

Jeremy


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to