Jannis Liedel writes about a great widget for FK fields
http://jannisleidel.com/2008/11/autocomplete-form-widget-foreignkey-model-fields/

I manged to get it to work on one site, but not on others.

Widget uses admin search functionality through url:
/admin/app/model/search/?
q=foo&search_fields=my_field&app_label=my_app&model_name=my_model

However, on some sites using same code and on the same server (running
django 1.1 and python 2.5) I get error:

invalid literal for int() with base 10: 'search'
Exception Location: /Library/Python/2.5/site-packages/django/db/models/
fields/__init__.py in get_db_prep_value, line 361
Python Executable: /System/Library/Frameworks/Python.framework/
Versions/2.5/Resources/Python.app/Contents/MacOS/Python
Python Version: 2.5.1

I tried several different aps, models and fields and got same result.
I googled about the error and all could get was that django can't
search on date fields that have None as default value, but that is not
the case for me here.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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