Skip to content

Editing records

The edit page lives at {resource}/{id}/edit. It loads the record, fills the resource form with its values, and titles the page with the record itself — Edit Launch Orbit rather than Edit Posts.

When the page mounts, Orbit finds the record by id — through the ORM model for database-backed resources, or from the resource’s seed list — and hydrates the form field by field. Nested keys the schema does not cover (wizard bags, JSON columns) are kept in state so they survive a save.

The heading comes from record_title_attribute:

class PostResource(Resource):
record_title_attribute = "title" # heading + breadcrumb leaf

Override get_record_title(record) for a computed title:

@classmethod
def get_record_title(cls, record) -> str:
return f"{record['reference']}{record['customer']}"

The breadcrumb trail shows the same title and links it to the record’s view page.

Submitting the form validates the schema, writes the changes (ORM update or in-memory replace), dispatches orbit-record-saved, and redirects to the record’s view page. A resource whose records are not mutable renders a read-only copy of the form with a short explanation instead.

The edit page shows View and Delete buttons by default. They are permission-aware: with a signed-in user, can_view and can_delete decide whether each appears; before you register policies everything stays visible so a fresh panel is usable.

Every relation manager with render_on set to "edit" or "both" renders below the form, so a post’s comments can be managed while the post itself is being edited:

class PostResource(Resource):
@classmethod
def get_relations(cls) -> list[type]:
return [CommentsRelationManager]

Turn on soft_deletes and the resource’s table gains a trashed filter plus restore and force-delete actions, and the page hosts learn the restore action:

class PostResource(Resource):
soft_deletes = True

Orbit soft-deleted records with restore actions (light)

Orbit soft-deleted records with restore actions (dark)

Restoring calls the model’s restore() when it has one, and otherwise clears deleted_at.