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
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
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
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
_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
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
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
7 matches
Mail list logo