Skip to content


Subversion checkout URL

You can clone with
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

35 lines (31 sloc) 1.033 kB
{-# LANGUAGE DeriveDataTypeable #-}
module Model
( module Model
, module Model.Types
) where
import Prelude
import Yesod
import Data.Text (Text, append)
import Data.Char (isUpper)
import qualified Data.Text as T
import Data.Time (UTCTime, Day)
import Database.Persist.Quasi
import Data.Typeable (Typeable)
import Model.Types
-- You can define all of your database entities in the entities file.
-- You can find more information on persistent and how to declare entities
-- at:
share [mkPersist sqlSettings, mkMigrate "migrateAll"]
$(persistFileWith upperCaseSettings
{ psToDBName = \t ->
if not (T.null t) && isUpper (T.head t)
then "Haskellers__" `append` psToDBName upperCaseSettings t
else psToDBName upperCaseSettings t
} "config/models")
userFullName' :: User -> Text
userFullName' u =
let s = userFullName u
in if T.length s > 50
then T.take 40 s `T.append` "..."
else s
Jump to Line
Something went wrong with that request. Please try again.