orm
orm copied to clipboard
How to support 'unique_together'
class RoleMenu(orm.Model): tablename = "role_menu" registry = registry_main
fields = {
"id": orm.BigInteger(primary_key=True),
"role_id": orm.BigInteger(index=True),
"menu_id": orm.BigInteger(index=True),
"is_active": orm.Boolean(default=False),
"is_new": orm.Boolean(default=True),
}
# unique_together = (("role_id", "menu_id"),)
Hi I needed this feature in this project, therefore in this PR I tried to implement it. I would really appreciate it if you take a look. Thank you!