[IMP] one2many feature added. Also improve some other codes and renamed template file.