Beispiel #1
0
 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)
Beispiel #2
0
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'),
    ))
Beispiel #3
0
 class Foo(models.Model):
     dict_ = models.DictField(
         'dict field!', fields=(
             models.IntegerField('ints', name='int'),
             models.TextField('texts', name='text'),
         )
     )
Beispiel #4
0
 class Foo(models.Model):
     name = models.TextField('name')
     age = models.IntegerField('age', default=5)