#911: addRemoveName in Catwalk is being ignored
-----------------------------+----------------------------------------------
 Reporter:  [EMAIL PROTECTED]       |        Owner:  anonymous
     Type:  defect           |       Status:  new      
 Priority:  high             |    Milestone:  1.0      
Component:  Toolbox.Catwalk  |      Version:  0.9a6    
 Severity:  normal           |   Resolution:           
 Keywords:  addRemoveName    |  
-----------------------------+----------------------------------------------
Changes (by jorge.vargas):

  * severity:  major => normal
  * milestone:  0.9 => 1.0
  * component:  Toolbox => Toolbox.Catwalk

Old description:

> It seems that when I customize the addRemoveName parameter, Catwalk no
> longer adds things properly.
>
> Here are two cases:
>
> Case #1:
> class List(SQLObject):
>         name = StringCol(notNone=True)
>         moderators = RelatedJoin('Member', addRemoveName='Moderator',
> joinColumn='list_id', otherColumn='member_id',
> intermediateTable='list_moderator')
>         members = RelatedJoin('Member')
>
> class Member(SQLObject):
>         fname = StringCol(notNone=True)
>         lname = StringCol(notNone=True)
>         moderatorFor = RelatedJoin('List', addRemoveName='ModeratorFor',
> joinColumn='member_id', otherColumn='list_id',
> intermediateTable='list_moderator')
>         lists = RelatedJoin('List')
>
> With this setup, I can add members, I can add lists, and I can even put
> members into lists.  However when I try to add a moderator to a list, it
> just adds another member.
>
> No errors are generated, but it's calling the addMember method instead of
> calling the addModerator method.
>
> Case #2:
>
> class Member(SQLObject):
>         fname = StringCol(notNone=True)
>         lname = StringCol(notNone=True)
>         submembers = RelatedJoin('Member', addRemoveName='SubMember',
> joinColumn='member_id', otherColumn='sub_member_id',
> intermediateTable='sub_member')
>
> If I want to have a RelatedJoin that relates to itself, I cannot do this
> either.  Catwalk displays the submembers relation, but when I click save
> as I try to add submembers I get an error, member object has no attribute
> addMember.
>
> Both cases seem like they are not ignoring the addRemoveName which I have
> set.

New description:

 It seems that when I customize the addRemoveName parameter, Catwalk no
 longer adds things properly.

 Here are two cases:

 Case #1:
 {{{
 class List(SQLObject):
         name = StringCol(notNone=True)
         moderators = RelatedJoin('Member', addRemoveName='Moderator',
 joinColumn='list_id', otherColumn='member_id',
 intermediateTable='list_moderator')
         members = RelatedJoin('Member')

 class Member(SQLObject):
         fname = StringCol(notNone=True)
         lname = StringCol(notNone=True)
         moderatorFor = RelatedJoin('List', addRemoveName='ModeratorFor',
 joinColumn='member_id', otherColumn='list_id',
 intermediateTable='list_moderator')
         lists = RelatedJoin('List')
 }}}
 With this setup, I can add members, I can add lists, and I can even put
 members into lists.  However when I try to add a moderator to a list, it
 just adds another member.

 No errors are generated, but it's calling the addMember method instead of
 calling the addModerator method.
 {{{
 Case #2:

 class Member(SQLObject):
         fname = StringCol(notNone=True)
         lname = StringCol(notNone=True)
         submembers = RelatedJoin('Member', addRemoveName='SubMember',
 joinColumn='member_id', otherColumn='sub_member_id',
 intermediateTable='sub_member')
 }}}
 If I want to have a RelatedJoin that relates to itself, I cannot do this
 either.  Catwalk displays the submembers relation, but when I click save
 as I try to add submembers I get an error, member object has no attribute
 addMember.

 Both cases seem like they are not ignoring the addRemoveName which I have
 set.

Comment:

 can you please provide a patch?

-- 
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/911>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Tickets" 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-tickets
-~----------~----~----~----~------~----~------~--~---

Reply via email to