switch to equals in most of the code, fix dependencies, clean tests, make all not relation fields work with type hints
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import asyncio
|
||||
from typing import Optional
|
||||
|
||||
import databases
|
||||
import pytest
|
||||
@ -17,8 +18,8 @@ class Department(ormar.Model):
|
||||
metadata = metadata
|
||||
database = database
|
||||
|
||||
id: ormar.Integer(primary_key=True, autoincrement=False)
|
||||
name: ormar.String(max_length=100)
|
||||
id = ormar.Integer(primary_key=True, autoincrement=False)
|
||||
name = ormar.String(max_length=100)
|
||||
|
||||
|
||||
class SchoolClass(ormar.Model):
|
||||
@ -27,9 +28,9 @@ class SchoolClass(ormar.Model):
|
||||
metadata = metadata
|
||||
database = database
|
||||
|
||||
id: ormar.Integer(primary_key=True)
|
||||
name: ormar.String(max_length=100)
|
||||
department: ormar.ForeignKey(Department, nullable=False)
|
||||
id = ormar.Integer(primary_key=True)
|
||||
name = ormar.String(max_length=100)
|
||||
department= ormar.ForeignKey(Department, nullable=False)
|
||||
|
||||
|
||||
class Category(ormar.Model):
|
||||
@ -38,8 +39,8 @@ class Category(ormar.Model):
|
||||
metadata = metadata
|
||||
database = database
|
||||
|
||||
id: ormar.Integer(primary_key=True)
|
||||
name: ormar.String(max_length=100)
|
||||
id = ormar.Integer(primary_key=True)
|
||||
name = ormar.String(max_length=100)
|
||||
|
||||
|
||||
class Student(ormar.Model):
|
||||
@ -48,10 +49,10 @@ class Student(ormar.Model):
|
||||
metadata = metadata
|
||||
database = database
|
||||
|
||||
id: ormar.Integer(primary_key=True)
|
||||
name: ormar.String(max_length=100)
|
||||
schoolclass: ormar.ForeignKey(SchoolClass)
|
||||
category: ormar.ForeignKey(Category, nullable=True)
|
||||
id = ormar.Integer(primary_key=True)
|
||||
name = ormar.String(max_length=100)
|
||||
schoolclass= ormar.ForeignKey(SchoolClass)
|
||||
category= ormar.ForeignKey(Category, nullable=True)
|
||||
|
||||
|
||||
class Teacher(ormar.Model):
|
||||
@ -60,10 +61,10 @@ class Teacher(ormar.Model):
|
||||
metadata = metadata
|
||||
database = database
|
||||
|
||||
id: ormar.Integer(primary_key=True)
|
||||
name: ormar.String(max_length=100)
|
||||
schoolclass: ormar.ForeignKey(SchoolClass)
|
||||
category: ormar.ForeignKey(Category, nullable=True)
|
||||
id = ormar.Integer(primary_key=True)
|
||||
name = ormar.String(max_length=100)
|
||||
schoolclass= ormar.ForeignKey(SchoolClass)
|
||||
category= ormar.ForeignKey(Category, nullable=True)
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
||||
Reference in New Issue
Block a user