Using a backref hides/overrides the primary key
hyperknot opened this issue · 2 comments
hyperknot commented
If there is a backref relationship defined on a children, the following is happening to the parent:
- The primary key's field disappears from the web UI.
- The backref's created field appears, and it takes the place of the primary key.
- Even specifying with sacrud_list_col = ['slug'], doesn't display the slug field, but the backref created field.
class Parent(Base):
__tablename__ = 'parents'
slug = Column(Unicode, primary_key=True)
name = Column(Unicode, nullable=False)
class Child(Base):
__tablename__ = 'children'
provider_slug = Column(Unicode, ForeignKey('parents.slug'), primary_key=True)
slug = Column(Unicode, primary_key=True)
provider = relationship('Parent', backref=backref('children'))
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
uralbash commented
Version 0.1.5 of sacrud_deform
will solve this problem. Just update it pip install -U sacrud_deform
. Please check it out and let me know that your problem solved or not.
hyperknot commented
Hi, I've migrated to a custom admin interface so unfortunately I cannot test out this solution.