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 #395 (closed defect: fixed)

Opened 9 years ago

Last modified 7 years ago

[PATCH]catwalk mangles NULL foreign keys

Reported by: smurf@… Owned by: anonymous
Priority: normal Milestone: 0.9
Component: Toolbox Version:
Severity: normal Keywords: develix
Cc:

Description

I have this model ..:

class Dir(sql.SQLObject):
    parent = sql.ForeignKey("Dir")
    [...]

Obviously there's a root directory (or several) with root.parent==None.

Editing such an object with catwalk does not show "NULL" as a valid option in the popup for parent. Thus when I save it I have an entry referring to itself. Ouch!

NB: This bug tracker probably should have a "CtaWalk?" compnent in its pop-up list ...

Attachments

__init__.patch Download (866 bytes) - added by anonymous 9 years ago.
This should work

Change History

comment:1 Changed 9 years ago by anonymous

  • Milestone set to 0.9

comment:2 Changed 9 years ago by kevin

  • Keywords develix added

Changed 9 years ago by anonymous

This should work

comment:3 Changed 9 years ago by joost@…

  • Summary changed from catwalk mangles NULL foreign keys to [PATCH]catwalk mangles NULL foreign keys

Setting default=None for the ForeignKey? in your model file 'solves' the problem the orginaly. I got a patch attached, please review first though.

comment:4 Changed 9 years ago by kevin

  • Component changed from TurboGears to Toolbox

comment:5 Changed 9 years ago by anonymous

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.