restore typing in tests and docs, remove unused metaclass code

This commit is contained in:
collerek
2020-11-01 10:11:25 +01:00
parent be35c80412
commit 358b5c2e52
49 changed files with 354 additions and 324 deletions

View File

@ -40,9 +40,9 @@ class Cover(ormar.Model):
metadata = metadata
database = database
id = ormar.Integer(primary_key=True)
album = ormar.ForeignKey(Album, related_name="cover_pictures")
title = ormar.String(max_length=100)
id: int = ormar.Integer(primary_key=True)
album: Optional[Album] = ormar.ForeignKey(Album, related_name="cover_pictures")
title: str = ormar.String(max_length=100)
class Organisation(ormar.Model):
@ -51,8 +51,8 @@ class Organisation(ormar.Model):
metadata = metadata
database = database
id = ormar.Integer(primary_key=True)
ident = ormar.String(max_length=100, choices=["ACME Ltd", "Other ltd"])
id: int = ormar.Integer(primary_key=True)
ident: str = ormar.String(max_length=100, choices=["ACME Ltd", "Other ltd"])
class Organization(object):
@ -65,9 +65,9 @@ class Team(ormar.Model):
metadata = metadata
database = database
id = ormar.Integer(primary_key=True)
org = ormar.ForeignKey(Organisation)
name = ormar.String(max_length=100)
id: int = ormar.Integer(primary_key=True)
org: Optional[Organisation] = ormar.ForeignKey(Organisation)
name: str = ormar.String(max_length=100)
class Member(ormar.Model):
@ -76,9 +76,9 @@ class Member(ormar.Model):
metadata = metadata
database = database
id = ormar.Integer(primary_key=True)
team = ormar.ForeignKey(Team)
email = ormar.String(max_length=100)
id: int = ormar.Integer(primary_key=True)
team: Optional[Team] = ormar.ForeignKey(Team)
email: str = ormar.String(max_length=100)
@pytest.fixture(autouse=True, scope="module")