class Foo(models.Model): foo_id = models.IntField(pk=True) name = models.CharField(max_length=255, index=True) tag = models.CharField(max_length=128) memo = models.TextField() class Meta: table = "foo_mapper"
class Event(models.Model): id = models.IntField(pk=True) name = models.TextField() datetime = models.DatetimeField(null=True) class Meta: table = "event" def __str__(self): return self.name
class Book(models.Model): id = models.IntField(pk=True) name = models.TextField() tag = models.CharField(max_length=120) class Meta: table = "book_test" def __str__(self): return self.name
class Book(models.Model): id = models.IntField(pk=True) name = models.CharField(max_length=255, index=True) description = models.TextField() created = models.DatetimeField(auto_now_add=True) updated = models.DatetimeField(auto_now=True) data_ver = models.DataVersionField() class Meta: table = "book"
class Foo(models.Model): foo_id = models.IntField(pk=True) name = models.CharField(max_length=255, index=True) tag = models.CharField(max_length=128) memo = models.TextField() content = models.JSONField() date = models.DateField() updated = models.DatetimeField(auto_now=True) created = models.DatetimeField(auto_now_add=True) class Meta: table = "foo_table" unique_together = ('name', 'date') indexes = ('name', 'tag')
class Foo(models.Model): foo_id = models.IntField(pk=True) content = models.TextField()
class IndexesContainWrongFieldModel(models.Model): id = models.AutoField() name = models.TextField() class Meta: indexes = ("name", "tag")
class IndexesListNotRightModel(models.Model): id = models.AutoField() name = models.TextField() class Meta: indexes = (1, 2, 3, 4)
class IndexesNotListModel(models.Model): id = models.AutoField() name = models.TextField() class Meta: indexes = 'name'
class ModelClassFromNotModel(NotModelClass, models.Model): id = models.AutoField() name = models.TextField()
class FooBar(Foo): bar_content = models.TextField()
class TextFieldsModel(models.Model): id = models.IntField(pk=True) text = models.TextField() text_null = models.TextField(null=True)