Skip to content

Instantly share code, notes, and snippets.

@Alir3z4
Created January 19, 2012 03:20
Show Gist options
  • Save Alir3z4/1637523 to your computer and use it in GitHub Desktop.
Save Alir3z4/1637523 to your computer and use it in GitHub Desktop.
from django.contrib import admin
from django.db import models
class Item(models.Model):
name = models.CharField(max_length=60)
created = models.DateTimeField(auto_now_add=True)
priority = models.IntegerField(default=0)
difficulty = models.IntegerField(default=0)
done = models.BooleanField(default=False)
class ItemAdmin(admin.ModelAdmin):
list_display = ["name", "priority", "difficulty", "created", "done"]
search_fields = ["name"]
admin.site.register(Item, ItemAdmin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment