Thanks for the accurate answer, it have a lot of sense to have an add method but I didn't know that it existed.
It doesn't exist. If you want to explicitly declare it:On Sat, May 17, 2008 at 01:59:03AM +0200, Luis Javier Peris wrote:
> 'm working with SQLObject and I'm getting frustated because of lack of
> examples. First of all, I'm having problems creating tables with
> many-many relationships
> by means of RelatedJoin. I want to create and know how work the CRUD
> operations in the tables created by RelatedJoin operation. I have two tables
> I've created as follow:
> class Term(SQLObject):
> name = StringCol(default=None)
> description = StringCol(default=None)
> vocabulary = ForeignKey('Vocabulary')
> term_questions = RelatedJoin('Question', joinColumn='question',
> class Question(SQLObject):
> question_file = StringCol(default=None, length=255, unique=True)
> question_name = StringCol(default=None)
> question_type = StringCol(default=None)
> term_questions = RelatedJoin('Term', joinColumn='term',
> So, I have a new table with two columns (term and question). How CRUD
> operations work?
> I've tried to create a new instance of Term_questions table:
> Term_questions(term=term.id, question=q.id), but the module Term_questions
> doesn't exist
term.term_questions is a list. If want to add an object to the join, use
> or if I try:
> q = Question(question_file="file", question_name= "name",
> term.term_questions = q.id
> I get: AttributeError: can't set attribute
Oleg Broytmann http://phd.pp.ru/ firstname.lastname@example.org
Programmers don't die, they just GOSUB without RETURN.
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
sqlobject-discuss mailing list