How to handle a composite constraint? #306
-
Hey all! I'm really enjoying Pickle's templating. However, I've come across a case I'm not sure how to deal with: type constraints on multiple class properties. Imagine I'm building a site that lists data about assorted flora:
I'd like to enforce that In the template I can only constrain Disclosure: in my real example the Edit: I have since also tried creating my final result ( All the alternatives I've considered either don't work or seem super ugly. Here are a few examples:
Because I'm working with a list of Plants, I also can't use Member predicates (as far as I can tell?). I'd like to know if there's a recommended way of managing this kind of situation. Thanks! (Some edits for clarity) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
This should do the trick: |
Beta Was this translation helpful? Give feedback.
This should do the trick:
flower: Flower(growsFlowers)?