Adjust yesod-form for split DB
This commit is contained in:
parent
7b35665d73
commit
1dea0ef5b1
@ -74,7 +74,7 @@ import Data.Text.Encoding (encodeUtf8, decodeUtf8With)
|
|||||||
import Data.Text.Encoding.Error (lenientDecode)
|
import Data.Text.Encoding.Error (lenientDecode)
|
||||||
import Network.URI (parseURI)
|
import Network.URI (parseURI)
|
||||||
import Database.Persist.Sql (PersistField, PersistFieldSql (..))
|
import Database.Persist.Sql (PersistField, PersistFieldSql (..))
|
||||||
import Database.Persist (Entity (..), SqlType (SqlString))
|
import Database.Persist (Entity (..), SqlType (SqlString), BaseBackend, PersistQueryRead)
|
||||||
import Text.HTML.SanitizeXSS (sanitizeBalance)
|
import Text.HTML.SanitizeXSS (sanitizeBalance)
|
||||||
import Control.Monad (when, unless)
|
import Control.Monad (when, unless)
|
||||||
import Data.Either (partitionEithers)
|
import Data.Either (partitionEithers)
|
||||||
@ -645,11 +645,13 @@ optionsEnum = optionsPairs $ map (\x -> (pack $ show x, x)) [minBound..maxBound]
|
|||||||
-- > <$> areq (selectField countries) "Which country do you live in?" Nothing
|
-- > <$> areq (selectField countries) "Which country do you live in?" Nothing
|
||||||
-- > where
|
-- > where
|
||||||
-- > countries = optionsPersist [] [Asc CountryName] countryName
|
-- > countries = optionsPersist [] [Asc CountryName] countryName
|
||||||
optionsPersist :: ( YesodPersist site, PersistEntity a
|
optionsPersist :: ( YesodPersist site
|
||||||
, PersistQuery (PersistEntityBackend a)
|
, PersistEntity a
|
||||||
|
, PersistQueryRead backend
|
||||||
, PathPiece (Key a)
|
, PathPiece (Key a)
|
||||||
, RenderMessage site msg
|
, RenderMessage site msg
|
||||||
, YesodPersistBackend site ~ PersistEntityBackend a
|
, YesodPersistBackend site ~ backend
|
||||||
|
, BaseBackend backend ~ PersistEntityBackend a
|
||||||
)
|
)
|
||||||
=> [Filter a]
|
=> [Filter a]
|
||||||
-> [SelectOpt a]
|
-> [SelectOpt a]
|
||||||
@ -671,10 +673,11 @@ optionsPersist filts ords toDisplay = fmap mkOptionList $ do
|
|||||||
optionsPersistKey
|
optionsPersistKey
|
||||||
:: (YesodPersist site
|
:: (YesodPersist site
|
||||||
, PersistEntity a
|
, PersistEntity a
|
||||||
, PersistQuery (PersistEntityBackend a)
|
, PersistQueryRead backend
|
||||||
, PathPiece (Key a)
|
, PathPiece (Key a)
|
||||||
, RenderMessage site msg
|
, RenderMessage site msg
|
||||||
, YesodPersistBackend site ~ PersistEntityBackend a
|
, backend ~ YesodPersistBackend site
|
||||||
|
, BaseBackend backend ~ PersistEntityBackend a
|
||||||
)
|
)
|
||||||
=> [Filter a]
|
=> [Filter a]
|
||||||
-> [SelectOpt a]
|
-> [SelectOpt a]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user