I know there are lots of view utility functions in views.py already, but let's start putting this one in utils.py or models.py.