Please register to create new tickets

Recipes

RUM can also be used to develop web applications: MoreThanCrud. It is designed to keep simple things simple and difficult things possible: SortByRelation

Is is also possible to enrich RUM applications by calls of a WebService to other resources. Further more sophisticated LayoutModifications are possible. It integrates well with SQLAlchemys facilities for AdvancedDataMapping.

Small Recipes

Reorder the automatically generated fields

paster shell ...
fields=[f.name for f in app.fields_for_resource(Document)]

In [13]: page fields
['occasion',
 'document_type',
 u'document_id',
 u'document_type_id',
 u'content',
 u'occasion_id',
 u'remark']

Copy that list to your code and reorder it:

FieldFactory.fields(Document,
[
 'document_type',
 'occasion',
 'document_id',
 'document_type_id',
 'content',
 'occasion_id',
 'remark']
)

Using that list the fields will still be automatically generated and automatically update to model changes. Of course, you can still explicitely instiate fields here, or add new ones (not detected by RUM).

In my case, I added a size field, which originates from a SA column property:

FieldFactory.fields(Document,
[ 
 Integer('size', read_only=True),
 'document_type',
 'occasion',
 'document_id',
 'document_type_id',
 'content',
 'occasion_id',
 'remark']
)