orm icon indicating copy to clipboard operation
orm copied to clipboard

How to support 'unique_together'

Open LuoLuo0101 opened this issue 3 years ago • 1 comments

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"),)

LuoLuo0101 avatar Mar 23 '22 03:03 LuoLuo0101

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!

SepehrBazyar avatar Apr 01 '22 22:04 SepehrBazyar