Hi,
I have several relations ($has_one) that are slowing down the speed of browsing the record inside model admin - because the relating table has a lot of rows and it is read ALL rows to create the drop down.
class ExampleObject extends DataObject
{
static $db = array(
'Stuff' => 'Text',
);
static $has_one = array(
'RelationToBigTable' => 'BigTable',
);
}
So I changed them to be read only text fields (as they are not for changing in the gui anyway!).
class ExampleObject extends DataObject
{
static $db = array(
'Stuff' => 'Text',
);
static $has_one = array(
'RelationToBigTable' => 'BigTable',
);
function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->insertAfter(new ReadonlyField('readonlyfield','RelationToBigTableID',$this->RelationToBigTableID),'Stuff');
$fields->removeByName('RelationToBigTableID');
return $fields;
}
}
I wonder if there is a way to link them to the other dataobject (also in the same model admin) so that I could turn it into a link and it would jump to editing that record?
Barry