make it django1.6 compatible, and add some relation tables