From 7a5034bbe4feb8625b3a6c534f07427ecf848ad8 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 21 Jan 2014 14:05:43 -0500 Subject: [PATCH] Update docs in TSN.XML.Injuries. --- src/TSN/XML/Injuries.hs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/TSN/XML/Injuries.hs b/src/TSN/XML/Injuries.hs index 6cc802f..eb369e0 100644 --- a/src/TSN/XML/Injuries.hs +++ b/src/TSN/XML/Injuries.hs @@ -82,7 +82,7 @@ data InjuriesTeam = -- * InjuriesListing/InjuriesListingXml --- | XML/Database representation of the injury listings. +-- | XML representation of the injury listings. -- data InjuriesListingXml = InjuriesListingXml { @@ -122,6 +122,9 @@ instance FromXmlFk InjuriesListingXml where db_injuries = xml_injuries, db_updated = xml_updated } +-- | This allows us to insert the XML representation +-- 'InjuriesListingXml' directly. +-- instance XmlImportFk InjuriesListingXml @@ -139,8 +142,7 @@ data Message = xml_time_stamp :: UTCTime } deriving (Eq, Show) --- | Database representation of a 'Message'. We really only care about --- the time stamp. +-- | Database representation of a 'Message'. -- data Injuries = Injuries { @@ -162,6 +164,9 @@ instance FromXml Message where db_sport = xml_sport, db_time_stamp = xml_time_stamp } +-- | This allows us to insert the XML representation 'Message' +-- directly. +-- instance XmlImport Message @@ -175,7 +180,8 @@ instance DbImport Message where migrate (undefined :: Injuries) migrate (undefined :: InjuriesListing) - -- | We import a 'Message' by inserting all of its 'listings'. + -- | We import a 'Message' by inserting all of its 'listings', but + -- the listings require a foreign key to the parent 'Message'. -- dbimport msg = do msg_id <- insert_xml msg -- 2.43.2