moved query info out of models.py