Converted ItemLink model to use query API from SQLAlchemy.