Creating records
Every resource gets a create page at {resource}/create. It renders the resource’s form with a Create button, and the heading uses the singular label — Create post, not Create Posts.


The form is the page
Section titled “The form is the page”class PostResource(Resource): model = Post model_label = "Post"
@classmethod def form(cls, form: Form) -> Form: return form.schema([ TextInput.make("title").required().max_length(200), Select.make("status") .options({"draft": "Draft", "published": "Published"}) .default("draft") .required(), Textarea.make("body").rows(6), ])The same schema powers create and edit. Use the operation context in a field’s callbacks when the two should differ — for example, a slug field that is editable on create and locked afterwards.
What submit does
Section titled “What submit does”- Field state lives on the page host, so every keystroke bound with
live()updates the server-side state. - Create runs validation from the schema; failures re-render the form with messages in place.
- For an ORM-backed resource, Orbit writes a row through the model (
idand timestamp columns are stripped, andfillableis honoured). - An
orbit-record-createdevent is dispatched and the browser is redirected to the new record’s view page.
For a seed-list resource the new row is appended in memory instead, which is what the demo resources in the sample app do.
Defaults
Section titled “Defaults”Set them on fields with default(...), or fill state before rendering when the value depends on context:
Select.make("status").options({...}).default("draft")TextInput.make("author").default(lambda user=None, **_: getattr(user, "name", ""))Read-only resources
Section titled “Read-only resources”A resource whose records are not mutable shows an explanatory note instead of a form:
class AuthorResource(Resource): records_mutable = FalseResources backed by an ORM model are mutable by default; seed lists are not unless you set records_mutable = True.
Page width
Section titled “Page width”Create, edit, and view pages use a narrower content width than the list page so forms stay readable. Override per resource:
class PostResource(Resource): form_content_max_width = "screen-md"Related pages
Section titled “Related pages”- Forms overview — every field type and layout
- Validation — rules, messages, and custom checks
- Editing records — the same schema after the record exists