0
我的問題是關於如何從查詢結果列表中提取每個實體Post的年份。如何從我的模型中提取yesod中處理程序的信息?
我的模型是這樣的:
Post
name Text
content Text
date UTCTime default=CURRENT_TIME
deriving Show
而且我的處理程序是這樣的:
getYearR :: Integer -> Handler Html
getYearR year = do
posts <- runDB $ selectList [] [Desc PostDate]
years <- --some function with posts for extract the list of years
defaultLayout $ do
aDomId <- newIdent
setTitle "Blog"
$(widgetFile "homepage")
也許溶液與約單子一些基本知識有關,但我不知道如何工作的對於這種情況。
感謝您的時間,我真的很感謝你的幫助