Minor tweaks for #590
This commit is contained in:
parent
f0ba8bb7f3
commit
5642489841
@ -516,6 +516,10 @@ optionsPersist filts ords toDisplay = fmap mkOptionList $ do
|
|||||||
, optionExternalValue = toPathPiece key
|
, optionExternalValue = toPathPiece key
|
||||||
}) pairs
|
}) pairs
|
||||||
|
|
||||||
|
-- | An alternative to 'optionsPersist' which returns just the @Key@ instead of
|
||||||
|
-- the entire @Entity@.
|
||||||
|
--
|
||||||
|
-- Since 1.3.2
|
||||||
optionsPersistKey
|
optionsPersistKey
|
||||||
:: (YesodPersist site
|
:: (YesodPersist site
|
||||||
, PersistEntity a
|
, PersistEntity a
|
||||||
@ -531,7 +535,7 @@ optionsPersistKey
|
|||||||
optionsPersistKey filts ords toDisplay = fmap mkOptionList $ do
|
optionsPersistKey filts ords toDisplay = fmap mkOptionList $ do
|
||||||
mr <- getMessageRender
|
mr <- getMessageRender
|
||||||
pairs <- runDB $ selectList filts ords
|
pairs <- runDB $ selectList filts ords
|
||||||
return $ Import.map (\(Entity key value) -> Option
|
return $ map (\(Entity key value) -> Option
|
||||||
{ optionDisplay = mr (toDisplay value)
|
{ optionDisplay = mr (toDisplay value)
|
||||||
, optionInternalValue = key
|
, optionInternalValue = key
|
||||||
, optionExternalValue = toPathPiece key
|
, optionExternalValue = toPathPiece key
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-form
|
name: yesod-form
|
||||||
version: 1.3.1
|
version: 1.3.2
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user