Forum .LRN Q&A: Why can't you get dotlrn-calendar applet's package_id?

Does anyone know why in dotlrn_community_applets for the dotlrn_calendar applet (don't get my started on why it was decided an applet key gets a _ and a package key gets a -) the package_id is not set?

This requires a lovely simple query to get the package_id:

select package_id from calendars where calendar_id in (select value from portal_element_parameters where element_id in (select element_id from portal_element_map where datasource_id=741 and page_id in (select page_id from portal_pages where portal_id = (select portal_id from dotlrn_communities_all where community_id = :community_id))) and key='calendar_id')

The deeply nested subqueries are because I built this up experimentally starting at the dotlrn_communities_all table.