Ok, so this has been driving me crazy for the past couple days...
I have a DataObject like so:
private static $db = array(
// other properties
'active' => 'Boolean',
'sort' => 'Int' // ID of another DataObject of this type, after which it is to be displayed.
);
private static $has_one = array('Page' => 'CustomPage');
The CustomPage just extends Page and has a has_many relationship with this DataObject.
The pain now for me is to get the data in a way that they're correctly sorted.
EDIT: The sort value is actually the ID of the DataObject after which to sort this one.
For example given the following:
ID sort
1 0
2 3
3 5
4 1
5 1
The result should be ordered like this:
ID
1
4
5
3
2
The sort can be duplicated, since I don't really want to bother with updating every item whenever I just add something in the middle.