Is there a way to have a relation which has a uniq...
# orm-help
s
Is there a way to have a relation which has a unique constraint? ie. a
Product
many:many
Category
relationship, states that a product can be in many categories, and a category has many products… BUT I want to ensure a product is unique within each category.
j
Did a quick lookup of the relation documentation and I can't see a way to do this. You'll most likely just have to do manual assertion.(It could be default behaviour already, I haven't checked as I'm not in front of the computer atm) You could create a feature request for it if it doesn't exist already though. Seems like a solution many would find good use for.