I have an ORM model Advert. In this class I set some fields as ruquired (for example brand_id (it has relations with another ORM model, but it doesn't matter)). When I create new advert - requerid fields are need.
Now I want to make search form. If I use Advert model, required fields are shown as required. But it is not correct. User should be able to fill fields that ge wants How can I "unset" the requirement?
I usually do it the other way around, fields that are not always required are defined as optional in the model, and I'll add the "required" rule in the controller when needed.