<timetable xmlns="http://schooltool.org/ns/timetable/0.1"
           xmlns:tal="http://xml.zope.org/namespaces/tal">
  <title tal:content="context/title"/>
  <timezone tal:attributes="name context/timezone" />
  <model tal:attributes="factory context/model/factory_id">
    <daytemplate tal:repeat="day view/daytemplates">
      <used tal:attributes="when day/used"/>
      <period tal:repeat="period day/periods"
              tal:attributes="tstart period/tstart;
                              duration period/duration;
                              id period/id" />
    </daytemplate>
    <day tal:repeat="day view/exceptiondayids"
         tal:attributes="when day/when;
                         id day/id" />
  </model>
  <day tal:repeat="item context/items"
       tal:attributes="id python:item[0]">
    <period tal:define="day python:item[1]"
            tal:repeat="period day/periods"
            tal:attributes="homeroom
                  python:[None, ''][period in day.homeroom_period_ids];
                            id period" />
  </day>
</timetable>
