What is the preferred method of returning to the results of a search

2010-07-24 Thread Erisa
I have a search view that presents an object_list with the search result. Each item provides a url to jump to an edit page. After editing (or deleting), I would like to return to the object_list page showing the results of the same search so I can edit or delete more items. What is preferred met

Strange error overriding changelist_view in ModelAdmin

2010-08-03 Thread Erisa
I have a Settings model that contains settings for my application. class Settings(models.Model): database_name = models.CharField(max_length=50) current_campaign = models.ForeignKey('Campaign') It only contains one object. I would like to be able to use the admin pages to edit it. Since

Re: Strange error overriding changelist_view in ModelAdmin

2010-08-03 Thread Erisa
I can't believe I missed the "self" problem, but when I fixed that I still received another strange error: Traceback: File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ base.py" in get_response 100. response = callback(request, *callback_args, **callback_kwarg

Re: Strange error overriding changelist_view in ModelAdmin

2010-08-03 Thread Erisa
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(Settin

Re: Strange error overriding changelist_view in ModelAdmin

2010-08-04 Thread Erisa
_view(self, request, object_id, extra_context=None) On Aug 3, 10:46 pm, Erisa 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

USStateField default value

2011-12-31 Thread Erisa
I wanted to have a select box for the state with California as the default. I first tried in my model the following: state = USStateField(blank=True, default='CA') This gave me the error "TypeError: __init__() got an unexpected keyword argument 'default'". But the following works (i.e., Califor

Re: USStateField default value

2012-01-01 Thread Erisa
Changing 'default' to 'initial' gives me an unexpected argument 'blank' error. If I remove the blank=True attribute, there is no error, but the select box is absent from the form! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this