examplary course-shorthand-filter in terms-list
This commit is contained in:
parent
710ace42bf
commit
0a433f06a5
@ -87,6 +87,13 @@ getTermShowR = do
|
|||||||
, dbtFilter = [ ( "active"
|
, dbtFilter = [ ( "active"
|
||||||
, FilterColumn $ \term -> (term E.^. TermActive :: E.SqlExpr (E.Value Bool))
|
, FilterColumn $ \term -> (term E.^. TermActive :: E.SqlExpr (E.Value Bool))
|
||||||
)
|
)
|
||||||
|
, ( "course"
|
||||||
|
, FilterColumn $ \term csh -> case csh of -- FilterColumn-Lambdas are
|
||||||
|
[] -> E.val True :: E.SqlExpr (E.Value Bool)
|
||||||
|
cshs -> E.exists . E.from $ \course -> do
|
||||||
|
E.where_ $ course E.^. CourseTerm E.==. term E.^. TermId
|
||||||
|
E.&&. course E.^. CourseShorthand `E.in_` E.valList cshs
|
||||||
|
)
|
||||||
]
|
]
|
||||||
, dbtAttrs = tableDefault
|
, dbtAttrs = tableDefault
|
||||||
, dbtIdent = "terms" :: Text
|
, dbtIdent = "terms" :: Text
|
||||||
|
|||||||
Reference in New Issue
Block a user