from django.db import models
from django.contrib import admin
from s7n.blog.models import Category, Entry

class CategoryAdmin(admin.ModelAdmin):
	prepopulated_fields = { 'slug': ['title'] }
admin.site.register(Category, CategoryAdmin)

class EntryAdmin(admin.ModelAdmin):
    prepopulated_fields = { 'slug': ['title'] }
    fields = ['title', 'slug', 'body', 'user', 'group', 'pub_date', 'pub_enddate', 'category', 'tag_list']
    list_display = ('title', 'user', 'group', 'category', 'pub_date', 'updated_date')
    list_filter = ('group', 'pub_date')
    ordering = ('-pub_date',)
    search_fields = ('title', 'body_html')

    def queryset(self, request):
        if request.user.is_superuser:
            qs = self.model.objects.get_query_set()
        else:
            qs = self.model.objects.get_query_set().filter(author = request.user)

        return qs
admin.site.register(Entry, EntryAdmin)

@@ -1,33 +1,4 @@
-from django.db import models%0A
 from
@@ -57,26 +57,16 @@
 port
- Category,
  Entry%0A%0A
 clas
@@ -65,138 +65,8 @@
 ry%0A%0A
-class CategoryAdmin(admin.ModelAdmin):%0A%09prepopulated_fields = %7B 'slug': %5B'title'%5D %7D%0Aadmin.site.register(Category, CategoryAdmin)%0A%0A
 clas
@@ -227,28 +227,16 @@
 nddate',
- 'category',
  'tag_li
@@ -289,20 +289,8 @@
 up',
- 'category',
  'pu

remove traces to category, which has been removed