add some database logics in models.py.