update docs part 1

This commit is contained in:
collerek
2020-10-06 19:09:58 +02:00
parent dd46dbcfd4
commit ba0990d05b
11 changed files with 505 additions and 212 deletions

View File

@ -8,14 +8,16 @@ metadata = sqlalchemy.MetaData()
class Course(ormar.Model):
__database__ = database
__metadata__ = metadata
class Meta:
database = database
metadata = metadata
id = ormar.Integer(primary_key=True)
name = ormar.String(length=100)
completed = ormar.Boolean(default=False)
id: ormar.Integer(primary_key=True)
name: ormar.String(max_length=100)
completed: ormar.Boolean(default=False)
print(Course.__table__.columns)
print(Course.Meta.table.columns)
"""
Will produce:
['courses.id', 'courses.name', 'courses.completed']