automatic queries based on model fields