Django choices. How to set default option?

How to set default STATUSES option ?

class Order(models.Model):
    STATUSES = (
        (u'E', u'Expected'),
        (u'S', u'Sent'),
        (u'F', u'Finished'),
    )

    status = models.CharField(max_length=2, null=True, choices=STATUSES)

Answers


status = models.CharField(max_length=2, null=True, choices=STATUSES, default='E')

or to avoid setting an invalid default if STATUSES changes:

status = models.CharField(max_length=2, null=True, choices=STATUSES, default=STATUSES[0][0])

Need Your Help

Changing the highlight color when selecting text in an HTML text input

html css text input highlight

I've been looking for this throughout the web and can't even find anyone else even asking this, let alone a solution...