Added has_many to Template and belongs_to to TemplateField