class Foo(models.Model): field = models.TextField( 'the field', fallbacks=[ models.SingleFieldFallback('old_field'), models.SingleFieldFallback('even_older_field')]) old_field = models.TextField( 'the old field', required=False) even_older_field = models.TextField( 'the oldest field', required=False)
class DumpAndLoadModel(models.Model): text = models.TextField('the näme') integer = models.IntegerField('the integer') float_ = models.FloatField('the float') boolean = models.BooleanField('the boolean') list_ = models.ListField('the list', fields=( models.IntegerField('the int'), )) dict_ = models.DictField('the dict', fields=( models.TextField('hello', name='hello'), ))
class Foo(models.Model): dict_ = models.DictField( 'dict field!', fields=( models.IntegerField('ints', name='int'), models.TextField('texts', name='text'), ) )
class Foo(models.Model): name = models.TextField('name') age = models.IntegerField('age', default=5)