from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin


class Contest(models.Model):
    name = models.CharField(max_length=64, unique=True)
    slug = models.SlugField(max_length=16, unique=True)
    initial_description = models.CharField(max_length=512, blank=False)
    ongoing_description = models.CharField(max_length=512, blank=False)
    tags = models.ManyToManyField(Tag)
    creators = models.ManyToManyField(User)

    created = models.DateTimeField(auto_now_add=True)
    modified = models.DateTimeField(auto_now=True)
    start_time = models.DateTimeField()
    end_time = models.DateTimeField()

    STATE_CHOICES = (('1', 'Not Started'), ('2', 'Ongoing'), ('3', 'Ended'))
    state = models.CharField(max_length=16, choices=STATE_CHOICES, default=1)

    def __str__(self):
        return self.name


class ContestAdmin(admin.ModelAdmin):
    list_display = ('name', 'start_time', 'end_time', 'modified', 'created', 'state')
    search_fields = ('name', )
    raw_id_fields = ('creators',)
    # readonly_fields = ('state',)
    list_filter = ('tags', 'state', 'created', 'creators')
    ordering = ['name', 'start_time', 'end_time', 'modified', 'created', 'state']

@@ -99,16 +99,44 @@
 t admin%0A
+from tags.models import Tag%0A
 %0A%0Aclass 
@@ -253,18 +253,18 @@
 _length=
-1
 6
+4
 , unique
@@ -1081,43 +1081,8 @@
 ',)%0A
-    # readonly_fields = ('state',)%0A
     
@@ -1218,8 +1218,76 @@
 state'%5D%0A
+    prepopulated_fields = %7B'slug': ('name', 'initial_description')%7D%0A

Update models.py of contests app