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:
collerek
2020-10-31 18:11:48 +01:00
parent 8fba94efa1
commit 7d5e291a19
47 changed files with 558 additions and 438 deletions

View File

@ -22,8 +22,8 @@ class JsonSample(ormar.Model):
metadata = metadata
database = database
id: ormar.Integer(primary_key=True)
test_json: ormar.JSON(nullable=True)
id = ormar.Integer(primary_key=True)
test_json= ormar.JSON(nullable=True)
class UUIDSample(ormar.Model):
@ -32,8 +32,8 @@ class UUIDSample(ormar.Model):
metadata = metadata
database = database
id: ormar.UUID(primary_key=True, default=uuid.uuid4)
test_text: ormar.Text()
id= ormar.UUID(primary_key=True, default=uuid.uuid4)
test_text = ormar.Text()
class User(ormar.Model):
@ -42,8 +42,8 @@ class User(ormar.Model):
metadata = metadata
database = database
id: ormar.Integer(primary_key=True)
name: ormar.String(max_length=100, default="")
id = ormar.Integer(primary_key=True)
name = ormar.String(max_length=100, default="")
class Product(ormar.Model):
@ -52,11 +52,11 @@ class Product(ormar.Model):
metadata = metadata
database = database
id: ormar.Integer(primary_key=True)
name: ormar.String(max_length=100)
rating: ormar.Integer(minimum=1, maximum=5)
in_stock: ormar.Boolean(default=False)
last_delivery: ormar.Date(default=datetime.now)
id = ormar.Integer(primary_key=True)
name = ormar.String(max_length=100)
rating = ormar.Integer(minimum=1, maximum=5)
in_stock= ormar.Boolean(default=False)
last_delivery= ormar.Date(default=datetime.now)
country_name_choices = ("Canada", "Algeria", "United States")
@ -70,12 +70,12 @@ class Country(ormar.Model):
metadata = metadata
database = database
id: ormar.Integer(primary_key=True)
name: ormar.String(
id = ormar.Integer(primary_key=True)
name = ormar.String(
max_length=9, choices=country_name_choices, default="Canada",
)
taxed: ormar.Boolean(choices=country_taxed_choices, default=True)
country_code: ormar.Integer(
taxed= ormar.Boolean(choices=country_taxed_choices, default=True)
country_code = ormar.Integer(
minimum=0, maximum=1000, choices=country_country_code_choices, default=1
)