--- | Specify how to convert between the two representations NewsTeam
--- (database) and NewsTeamXml (XML).
-instance ToFromXml NewsTeam where
- type Xml NewsTeam = NewsTeamXml
- type Container NewsTeam = Message
- -- Use a record wildcard here so GHC doesn't complain that we never
- -- used our named fields.
- to_xml (NewsTeam {..}) = NewsTeamXml db_team_name
- -- We can't create a DefaultKey Message...
- from_xml = error "Called from_xml on a NewsTeam."
- -- unless we're handed one.
- from_xml_fk key = (NewsTeam key) . xml_team_name
-
-
--- | The database type for locations as they show up in the news. We
--- need this separate from its XML representation because of the
--- DefaultKey pointing to a message. We don't know how to create one
--- of those unless we've just inserted a message into the database,
--- so it screws up pickling.
+-- | Mapping between News records and NewsTeam records in the
+-- database. We name the fields (even though they're never used) for
+-- Groundhog's benefit.
+data News_NewsTeam =
+ News_NewsTeam {
+ nnt_news_id :: DefaultKey News,
+ nnt_news_team_id :: DefaultKey NewsTeam }
+
+-- | The database type for locations as they show up in the news.