Moved some model-specific and validation code from views.py into models.py and forms.py