Skip to content

Commit

Permalink
docs: update document
Browse files Browse the repository at this point in the history
Signed-off-by: ktro2828 <[email protected]>
  • Loading branch information
ktro2828 committed Nov 27, 2024
1 parent fa808da commit b06bb2d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/tutorials/customize.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
## Generate Schema with a new token

---

You can crate a schema containing the specified table data with a new token using `new(...)` methods.

```python title="generate_attribute.py"
from t4_devkit.schema import Attribute, serialize_schema

# table data without the token field
data = {
"name": "foo",
"description": "this is re-generated attribute."
}

attr1 = Attribute.new(data)

# Also, it allows us to create a copy of the existing table data with a new token
serialized = serialize_schema(attr1)
attr2 = Attribute.new(serialized)

assert attr1.token != attr2.token
```

## Customize Schema

---
Expand Down

0 comments on commit b06bb2d

Please sign in to comment.