Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #582 (closed defect: duplicate)

Opened 13 years ago

Last modified 12 years ago

[PATCH] CatWalk cannot handle multiple RelatedJoin to the same model in one Model Class

Reported by: anonymous Owned by: anonymous
Priority: high Milestone: 1.0b2
Component: Toolbox.Catwalk Version:
Severity: normal Keywords: catwalk relatedjoin addRemoveName
Cc: igor@…

Description

I am using turbogears TurboGears 0.9a0dev-r757 with SQLObject SQLObject 0.7.1dev-r1457

Consider this Model

Model A(SQLObject):
   name = StringCol()
Model Foo(SQLObject):
   stuff = IntCol()
   good_as = RelatedJoin(intermediateTable="foo_a_good",addRemoveName="GoodOne")
   bad_as = RelatedJoin(intermediateTable="foo_a_bad",addRemoveName="BadOne")

Catwalk will display both relations seperatly but trying to save changes to one of them will fail, because Catwalk tries to call addA (which would be the default name of the corresponding helper method in model Foo).

Instead it should look at Foo.sqlmeta.joins and determine the method with the help of Foo.sqlmeta.joins[xxx].addRemoveName instead. If addRemoveName is not defined, use the default

Attachments

582.patch Download (2.2 KB) - added by Joost 13 years ago.
addRemoveName fix

Change History

comment:1 Changed 13 years ago by anonymous

  • Status changed from new to assigned

comment:2 Changed 13 years ago by anonymous

  • Status changed from assigned to new

Changed 13 years ago by Joost

addRemoveName fix

comment:3 Changed 13 years ago by Joost

  • Summary changed from CatWalk cannot handle multiple RelatedJoin to the same model in one Model Class to [patch]CatWalk cannot handle multiple RelatedJoin to the same model in one Model Class

This solves the addRemoveName isue. Having multiple relatedjoins in one model class shouldn't be a problem as long the addRemoveName has been defined. Maybe we should raise an exception when there are more than one related joins with the same addRemoveName?

comment:4 Changed 13 years ago by anonymous

  • Summary changed from [patch]CatWalk cannot handle multiple RelatedJoin to the same model in one Model Class to [PATCH] CatWalk cannot handle multiple RelatedJoin to the same model in one Model Class

comment:5 Changed 13 years ago by jorge.vargas

  • Component changed from Toolbox to Toolbox.Catwalk
  • Severity changed from major to normal
  • Milestone changed from 0.9 to 1.0b2

this seems commitable :)

comment:6 Changed 12 years ago by Joost

  • Status changed from new to closed
  • Resolution set to duplicate

I'm clossing this one as its a dupplicate of http://trac.turbogears.org/turbogears/ticket/911. An updated patch has been attached to ticket 911.

Note: See TracTickets for help on using tickets.