Hi,
I need to use customs admin classes for two entities linked by a OneToMany relationship.
So, when I open A and call B in the A form, I don't want to see the A attribute in the B form. And vice-versa! But Camelot complains because he can't find the B custom admin class if B is not declared before A in the model.py file, but I have to declare A before B to give B the access of the custom admin class of A (infinite loop on!).
Don't work :
class A(Entity):
Bs = relationship('B', backref="A")
class Admin(EntityAdmin):
form_display = ['id', 'Bs']
field_attributes = {'Bs': {'admin': B.AdminWithoutA,},}
class AdminWithoutB(EntityAdmin):
form_display = ['id']
class B(Entity):
A_id = Column(Integer, ForeignKey('A.id'), nullable=False)
class Admin(EntityAdmin):
form_display = ['id', 'A']
field_attributes = {'A': {'admin': A.AdminWithoutB,},}
class AdminWithoutA(EntityAdmin):
form_display = ['id']
Any idea? Thanks