diff --git a/README.rst b/README.rst index 37ff325..b407476 100644 --- a/README.rst +++ b/README.rst @@ -223,42 +223,39 @@ Features * Lazy loading, best for circular references: - ..code-block:: python - - class Primary(models.Base): - - name = fields.StringField() - secondary = fields.EmbeddedField('Secondary') - + .. code-block:: python - class Secondary(models.Base): + >>> class Primary(models.Base): + ... + ... name = fields.StringField() + ... secondary = fields.EmbeddedField('Secondary') - data = fields.IntField() - first = fields.EmbeddedField('Primary') + >>> class Secondary(models.Base): + ... + ... data = fields.IntField() + ... first = fields.EmbeddedField('Primary') You can use either `Model`, full path `path.to.Model` or relative imports `.Model` or `...Model`. * Using definitions to generate schema for circular references: - ..code-block:: python - - class File(models.Base): - - name = fields.StringField() - size = fields.FloatField() - - - class Directory(models.Base): - - name = fields.StringField() - children = fields.ListField(['Directory', File]) + .. code-block:: python + >>> class File(models.Base): + ... + ... name = fields.StringField() + ... size = fields.FloatField() - class Filesystem(models.Base): + >>> class Directory(models.Base): + ... + ... name = fields.StringField() + ... children = fields.ListField(['Directory', File]) - name = fields.StringField() - children = fields.ListField([Directory, File]) + >>> class Filesystem(models.Base): + ... + ... name = fields.StringField() + ... children = fields.ListField([Directory, File]) >>> Filesystem.to_json_schema() {