mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
38b50c2977
Fix the `Reference` class, make it work with the new model and allow it to be dereferences via the `_accessor` attribute.
16 lines
543 B
Markdown
16 lines
543 B
Markdown
# rev.ng model classes
|
|
|
|
By default, importing the top level package will expose the classes for the latest version of the model.
|
|
|
|
Example: deserializing a model
|
|
|
|
```python
|
|
import yaml
|
|
from revng import model as m
|
|
|
|
with open("/path/to/model.yaml") as f:
|
|
model = m.Binary.deserialize(f)
|
|
```
|
|
|
|
It is not possible to import a model with a schema version other than the latest. In order to load older models, you first need to migrate them, either using the `revng.model.migrations` Python module or using the `revng model migrate` CLI command.
|