Fix inconsistencies in documentation

- Use max_length instead of length for String field
- Use same annotations in README.md and index.md as in docs_src
This commit is contained in:
Igor Nehoroshev
2020-11-03 19:22:09 +02:00
parent 8e2a368203
commit a72478d33d
3 changed files with 13 additions and 13 deletions

View File

@ -79,8 +79,8 @@ class Album(ormar.Model):
# note that type hints are optional so
# id = ormar.Integer(primary_key=True)
# is also valid
id = ormar.Integer(primary_key=True)
name = ormar.String(length=100)
id: int = ormar.Integer(primary_key=True)
name: str = ormar.String(max_length=100)
class Track(ormar.Model):
@ -89,10 +89,10 @@ class Track(ormar.Model):
metadata = metadata
database = database
id = ormar.Integer(primary_key=True)
album = ormar.ForeignKey(Album)
title = ormar.String(length=100)
position = ormar.Integer()
id: int = ormar.Integer(primary_key=True)
album: Optional[Album] = ormar.ForeignKey(Album)
title: str = ormar.String(max_length=100)
position: int = ormar.Integer()
# Create some records to work with.

View File

@ -79,8 +79,8 @@ class Album(ormar.Model):
# note that type hints are optional so
# id = ormar.Integer(primary_key=True)
# is also valid
id = ormar.Integer(primary_key=True)
name = ormar.String(length=100)
id: int = ormar.Integer(primary_key=True)
name: str = ormar.String(max_length=100)
class Track(ormar.Model):
@ -89,10 +89,10 @@ class Track(ormar.Model):
metadata = metadata
database = database
id = ormar.Integer(primary_key=True)
album = ormar.ForeignKey(Album)
title = ormar.String(length=100)
position = ormar.Integer()
id: int = ormar.Integer(primary_key=True)
album: Optional[Album] = ormar.ForeignKey(Album)
title: str = ormar.String(max_length=100)
position: int = ormar.Integer()
# Create some records to work with.

View File

@ -50,7 +50,7 @@ Will produce:
'name': mappingproxy({'allow_blank': False,
'autoincrement': False,
'choices': set(),
'column_type': String(length=100),
'column_type': String(max_length=100),
'curtail_length': None,
'default': None,
'index': False,