diff --git a/docs/tutorials/customize.md b/docs/tutorials/customize.md index f7d76f4..7e5be6d 100644 --- a/docs/tutorials/customize.md +++ b/docs/tutorials/customize.md @@ -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 ---