fix dependency import

This commit is contained in:
long2ice
2020-05-21 13:44:09 +08:00
parent bf1d745cef
commit 23dd29644c
5 changed files with 11 additions and 28 deletions

View File

@@ -30,9 +30,6 @@ class User(Model):
avatar = fields.CharField(max_length=200, default="")
intro = fields.TextField(default="")
def __str__(self):
return f"{self.pk}#{self.username}"
class Category(Model):
slug = fields.CharField(max_length=200)
@@ -40,9 +37,6 @@ class Category(Model):
user = fields.ForeignKeyField("models.User", description="User")
created_at = fields.DatetimeField(auto_now_add=True)
def __str__(self):
return f"{self.pk}#{self.name}"
class Product(Model):
categories = fields.ManyToManyField("models.Category")
@@ -55,15 +49,9 @@ class Product(Model):
body = fields.TextField()
created_at = fields.DatetimeField(auto_now_add=True)
def __str__(self):
return f"{self.pk}#{self.name}"
class Config(Model):
label = fields.CharField(max_length=200)
key = fields.CharField(max_length=20)
value = fields.JSONField()
status: Status = fields.IntEnumField(Status, default=Status.on)
def __str__(self):
return f"{self.pk}#{self.label}"

View File

@@ -48,7 +48,6 @@ class TestDDL(test.TruncationTestCase):
);""",
)
elif isinstance(self.ddl, PostgresDDL):
print(ret)
self.assertEqual(
ret,
"""CREATE TABLE IF NOT EXISTS "category" (

View File

@@ -1,5 +0,0 @@
from tortoise.contrib import test
class TestMigrate(test.TruncationTestCase):
pass