I have an Event dataobject and a DateTime dataobject. The Event has a $has_many for "Showtimes" => "DateTime" and the DateTime has a $has_one for "Event" => "Event". I have these in a CTF in ModelAdmin. Right now I can create a new Event and if I add the Event then add DateTimes, everything works. The DateTimes get the EventID field populated correctly because the Event already exists in the database.
In the more likely case, a user will create a new Event, add a title, etc... then try to add some DateTimes. Since the Event does not exist in the database, there is no ID to populate EventID in the DateTimes so it gets set to 0.
Should Silverstripe handle this automatically? Is there any way to have it so the user does not need to add an Event before adding DateTimes?