Hi All
#my function code
def object_list(request, object, filter_string = None):
if filter:
object_list = object.objects.filter(filter_string)
else:
object_list = object.objects.all()
return render_to_response(object.__name__ + '_list.html',
{object.__name__ + '_list': object_list},
RequestContext(request))
When I call this with a string value for filter_string like below:
def location_list(request):
if request.has_key('entity'):
return object_list(request, location, 'entity_id=' +
request['entity'])
else:
return object_list(request, location)
I get the following error message.
'unicode' object has no attribute 'get_sql'
How to pass on a string to the filter() method?
Thanks in advance
Regards Ganesh
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---