]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/TSN/XML/Odds.hs
Update TSN.XML modules to use the new Child class.
[dead/htsn-import.git] / src / TSN / XML / Odds.hs
index 2ad2d93ebb14111896f35fe6638b36a3a40cc424..c4f00266b6fbfa398442056d2d47249da77cf3ce 100644 (file)
@@ -68,6 +68,7 @@ import TSN.Picklers ( xp_date_padded, xp_time, xp_time_stamp )
 import TSN.Team ( Team(..) )
 import TSN.XmlImport ( XmlImport(..), XmlImportFk(..) )
 import Xml (
+  Child(..),
   FromXml(..),
   FromXmlFk(..),
   ToDb(..),
@@ -187,8 +188,8 @@ instance FromXml OddsGameHomeTeamXml where
   from_xml OddsGameHomeTeamXml{..} =
     Team {
       team_id   = xml_home_team_id,
-      team_abbreviation = Just xml_home_team_abbr,
-      team_name = Just xml_home_team_name }
+      abbreviation = Just xml_home_team_abbr,
+      name = Just xml_home_team_name }
 
 -- | This allows us to insert the XML representation
 --   'OddsGameHomeTeamXml' directly.
@@ -325,12 +326,15 @@ instance ToDb OddsGameXml where
   --
   type Db OddsGameXml = OddsGame
 
-instance FromXmlFk OddsGameXml where
+
+instance Child OddsGameXml where
   -- | Each 'OddsGameXml' is contained in an 'Odds'. In other words
   --   the foreign key for 'OddsGame' points to an 'Odds'.
   --
   type Parent OddsGameXml = Odds
 
+
+instance FromXmlFk OddsGameXml where
   -- | To convert from the XML representation to the database one, we
   --   drop the home/away teams and the casino lines, but retain the
   --   home/away rotation numbers and the starters.