i want to pass a variable by URL to another page in django admin. it seems it is not working, i want to pass the variable "/?name=hello", and catch it by request.GET.get["name",""].but the url becomes "/?e=1" after it passed. if i use the default parameter'q', it works, but it will have a conflict. it seems this problem is django-admin only. and i need pass it by url not post... does any one knows how to solve this problem
thanks
The problem is that the lookup
name
does not exist when theget_query_set
tries to resolve it as a model field. Thus anIncorrectLookupParameters()
exception is raised which in turn redirects to the not very helpful "e=1" url. This problem is solved in Django 1.4 with the introduction of custom filterspecs. Until then one possible solution is to dynamically overwrite theChangeList
class returned by yourModelAdmins
get_changelist()
method.This solution works on Django 1.3:
Can you explain your problem a bit more....why do you want to pass a variable to django admin... also you cant catch GET variable like this... Either use:
or
.get is a instancemethod not a dictionary.