class Order(DeclarativeBase):
...
user = relation("User", backref=backref('orders', order_by=order_id,cascade_backrefs=False), cascade="",cascade_backrefs=False)
...
#standard TG User
class User(DeclarativeBase):
...
class __sprox__(object):
omit_fields = ['orders','_password']then the orders field won't show in html output in TG Admin, but SAORMProvider.put() will try to update them, resulting in unwanted updates or database constraint violation. My quick fix was to add the check
try:
if key in entity.__sprox__.omit_fields:
continue
except:
pass
into SAORMProvider.put() and SAORMProvider._remove_related_empty_params() loops.
I can provide the patch for pulling if it's on right track. But, there were some other trouble saving the orders even even if the field is not omitted at all. I did not research this yet, maybe it relies on cascade_backrefs being on.
Regards,
Juraj