From ad12ce63f0502bb7418feea8f73058f54f3d11d2 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sat, 7 Jan 2012 19:23:56 +0200 Subject: [PATCH] Minor fixes --- yesod-auth/yesod-auth.cabal | 2 +- yesod-form/Yesod/Form/Fields.hs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/yesod-auth/yesod-auth.cabal b/yesod-auth/yesod-auth.cabal index f898fdda..84d4f873 100644 --- a/yesod-auth/yesod-auth.cabal +++ b/yesod-auth/yesod-auth.cabal @@ -43,7 +43,7 @@ library , persistent >= 0.7 && < 0.8 , persistent-template >= 0.7 && < 0.8 , SHA >= 1.4.1.3 && < 1.6 - , http-conduit >= 1.0 && < 1.1 + , http-conduit >= 1.1 && < 1.2 , aeson >= 0.5 , pwstore-fast >= 2.2 && < 3 diff --git a/yesod-form/Yesod/Form/Fields.hs b/yesod-form/Yesod/Form/Fields.hs index 7a290207..bd5bf758 100644 --- a/yesod-form/Yesod/Form/Fields.hs +++ b/yesod-form/Yesod/Form/Fields.hs @@ -53,6 +53,7 @@ import Data.Time (Day, TimeOfDay(..)) import qualified Text.Email.Validate as Email import Network.URI (parseURI) import Database.Persist (PersistField) +import Database.Persist.Query (Entity (..)) import Text.HTML.SanitizeXSS (sanitizeBalance) import Control.Monad (when, unless) import Data.List (intersect, nub) @@ -414,12 +415,12 @@ optionsPersist :: ( YesodPersist master, PersistEntity a , PersistQuery (YesodPersistBackend master) (GHandler sub master) , PathPiece (Key (YesodPersistBackend master) a) ) - => [Filter a] -> [SelectOpt a] -> (a -> Text) -> GHandler sub master (OptionList (Key (YesodPersistBackend master) a, a)) + => [Filter a] -> [SelectOpt a] -> (a -> Text) -> GHandler sub master (OptionList (Entity (YesodPersistBackend master) a)) optionsPersist filts ords toDisplay = fmap mkOptionList $ do pairs <- runDB $ selectList filts ords - return $ map (\(key, value) -> Option + return $ map (\(Entity key value) -> Option { optionDisplay = toDisplay value - , optionInternalValue = (key, value) + , optionInternalValue = Entity key value , optionExternalValue = toPathPiece key }) pairs