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

Opened 10 years ago

Last modified 10 years ago

TG2 admin pages fail validation if 1:M backref relationships are empty

Reported by: mwtb Owned by: percious
Priority: normal Milestone: 2.1a2
Component: Catwalk2 Version: 2.0rc1
Severity: normal Keywords:
Cc:

Description (last modified by jorge.vargas) (diff)

Using the models below, on trying to create a Product with no ProductVersions? existing, the form fails validation with "Missing Value" against the Versions entry.

class Product(DeclarativeBase):
    __tablename__ = 'products'

    #{ Columns

    id = Column(Integer, primary_key=True)
    name = Column(Unicode(128), nullable=False)
    description = Column(Unicode(1024), nullable=False)
    created = Column(DateTime, default=datetime.now)

    #}
	

class ProductVersion(DeclarativeBase):
    __tablename__ = 'product_versions'

    #{ Columns

    id = Column(Integer, primary_key=True)
    version_label = Column(Unicode(128), nullable=False)
    resource_location = Column(Unicode(1024), nullable=False)
    created = Column(DateTime, default=datetime.now)

    product_id = Column(Integer, ForeignKey('products.id'))

    product = relation(Product, backref=backref('versions', order_by=id))

Change History

comment:1 Changed 10 years ago by jorge.vargas

  • Owner set to percious
  • Component changed from TurboGears to Catwalk2
  • Description modified (diff)

comment:2 Changed 10 years ago by percious

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

I just verified this works with the current tgext.admin, tgext.crud, and sprox.

Note: See TracTickets for help on using tickets.