Update models.py

added better constraints