Oops! I copied the old class with the "self" mistake left in.  The
correct class is:

class SettingsAdmin(admin.ModelAdmin):
    def changelist_view(self, request, extra_context=None):
        object_id = str(Settings.objects.all()[0].id)
        return super(SettingsAdmin, self).change_view(self, request,
object_id, extra_context=None)


On Aug 3, 10:46 pm, Erisa <bruceaw...@gmail.com> wrote:
> I found the problem.  The object_id needs to be a string!  So the
> following works like a charm:
>
> from wolkdata.database.models import *
> from django.contrib import admin
>
> class SettingsAdmin(admin.ModelAdmin):
>     def changelist_view(self, request, extra_context=None):
>         object_id = str(Settings.objects.all()[0].id)
>         return super(SettingsAdmin, self).change_view(self, request,
> object_id, extra_context=None)
>
> admin.site.register(Settings, SettingsAdmin)
>
> When I click on the Settings option on the admin page I go right to
> the change_view page.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to