X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FTSN%2FXML%2FAutoRacingSchedule.hs;h=01611d237157e0fa52d98fd36406afef7337be0b;hb=b0a87f9323223a0af538184940b35a081f5763af;hp=1f459860244b33d0e5c7b6b1d907e074a40e200b;hpb=0fa2d93c7fe436038e0f2b14d68b9e3cc3e165f7;p=dead%2Fhtsn-import.git diff --git a/src/TSN/XML/AutoRacingSchedule.hs b/src/TSN/XML/AutoRacingSchedule.hs index 1f45986..01611d2 100644 --- a/src/TSN/XML/AutoRacingSchedule.hs +++ b/src/TSN/XML/AutoRacingSchedule.hs @@ -59,6 +59,7 @@ import TSN.DbImport ( DbImport(..), ImportResult(..), run_dbmigrate ) import TSN.Picklers ( xp_date_padded, xp_tba_time, xp_time_stamp ) import TSN.XmlImport ( XmlImport(..), XmlImportFk(..) ) import Xml ( + Child(..), FromXml(..), FromXmlFk(..), ToDb(..), @@ -140,7 +141,7 @@ instance XmlImport Message -- * AutoRacingScheduleListing/AutoRacingScheduleListingXml -- | Database representation of a \ contained within a --- \. We combine the race date/time into a single +-- \. We combine the race date/time into a single -- race_time, drop the race results list, and add a foreign key to -- our parent. -- @@ -192,12 +193,15 @@ instance ToDb AutoRacingScheduleListingXml where -- type Db AutoRacingScheduleListingXml = AutoRacingScheduleListing -instance FromXmlFk AutoRacingScheduleListingXml where + +instance Child AutoRacingScheduleListingXml where -- | Each 'AutoRacingScheduleListingXml' is contained in (i.e. has a -- foreign key to) a 'AutoRacingSchedule'. -- type Parent AutoRacingScheduleListingXml = AutoRacingSchedule + +instance FromXmlFk AutoRacingScheduleListingXml where -- | To convert an 'AutoRacingScheduleListingXml' to an -- 'AutoRacingScheduleListing', we add the foreign key and drop -- the 'xml_race_results'. We also mash the date/time together @@ -244,8 +248,7 @@ newtype AutoRacingScheduleListingRaceResult = deriving (Eq, Show) --- * AutoRacingScheduleListingRaceResultRaceResultListing / --- AutoRacingScheduleListingRaceResultRaceResultListingXml +-- * AutoRacingScheduleListingRaceResultRaceResultListing / AutoRacingScheduleListingRaceResultRaceResultListingXml -- -- Sorry about the names yo. -- @@ -290,7 +293,7 @@ instance ToDb AutoRacingScheduleListingRaceResultRaceResultListingXml where AutoRacingScheduleListingRaceResultRaceResultListing -instance FromXmlFk AutoRacingScheduleListingRaceResultRaceResultListingXml where +instance Child AutoRacingScheduleListingRaceResultRaceResultListingXml where -- | Each 'AutoRacingScheduleListingRaceResultRaceResultListingXml' -- is contained in (i.e. has a foreign key to) an -- 'AutoRacingScheduleListing'. We skip the intermediate @@ -299,6 +302,8 @@ instance FromXmlFk AutoRacingScheduleListingRaceResultRaceResultListingXml where type Parent AutoRacingScheduleListingRaceResultRaceResultListingXml = AutoRacingScheduleListing + +instance FromXmlFk AutoRacingScheduleListingRaceResultRaceResultListingXml where -- | To convert an -- 'AutoRacingScheduleListingRaceResultRaceResultListingXml' to an -- 'AutoRacingScheduleListingRaceResultRaceResultListing', we just