I have countries and currencies.
The relationship is : country has_one currency, with a currency_id column in countries
When editing a country, I want to assign a currency to the country. I use the htmlform extension (I know it's not supported anymore, but maybe some of you guys use it).
I pass this to render_form() :
I have a 'currency' pull-out menu generated, and everything's fine.
Question : I have a 'Status' column in currencies, which is an ENUM set either to 'Active' or 'Inactive'.
At the moment, when creating the $country object, it retrieves all of the currencies.
How can I populate $country->currency with only currencies that are 'Active',
and then passing it to $country->render_form() ?
Can a subquery do the trick (the following does not work) ?
or am I forced to create a currency object, and then pass it explicitely to the form, thus unexploiting the automatization process htmlform() provides ?