In my attempt to use 

   ForeignKey(Track, null=True) 

When I actually tried to use a null Track value, I got:

  Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" in 
get_response
    77. response = callback(request, *callback_args, **callback_kwargs)
  File 
"/usr/lib/python2.4/site-packages/django/contrib/admin/views/decorators.py" in 
_checklogin
    55. return view_func(request, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/django/views/decorators/cache.py" in 
_wrapped_view_func
    39. response = view_func(request, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/django/contrib/admin/views/main.py" in 
change_stage
    325. errors = manipulator.get_validation_errors(new_data)
  File "/usr/lib/python2.4/site-packages/django/oldforms/__init__.py" in 
get_validation_errors
    59. errors.update(field.get_validation_errors(new_data))
  File "/usr/lib/python2.4/site-packages/django/oldforms/__init__.py" in 
get_validation_errors
    357. self.run_validator(new_data, validator)
  File "/usr/lib/python2.4/site-packages/django/oldforms/__init__.py" in 
run_validator
    347. validator(new_data.get(self.field_name, ''), new_data)
  File "/usr/lib/python2.4/site-packages/django/db/models/manipulators.py" in 
manipulator_validator_unique_together
    299. old_obj = self.manager.get(**kwargs)
  File "/usr/lib/python2.4/site-packages/django/db/models/manager.py" in get
    67. return self.get_query_set().get(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/django/db/models/query.py" in get
    211. obj_list = list(clone)
  File "/usr/lib/python2.4/site-packages/django/db/models/query.py" in __iter__
    103. return iter(self._get_data())
  File "/usr/lib/python2.4/site-packages/django/db/models/query.py" in _get_data
    430. self._result_cache = list(self.iterator())
  File "/usr/lib/python2.4/site-packages/django/db/models/query.py" in iterator
    172. cursor.execute("SELECT " + (self._distinct and "DISTINCT " or "") + 
",".join(select) + sql, params)
  File "/usr/lib/python2.4/site-packages/django/db/backends/util.py" in execute
    12. return self.cursor.execute(sql, params)
  File "/usr/lib/python2.4/site-packages/django/db/backends/postgresql/base.py" 
in execute
    43. return self.cursor.execute(sql, [smart_basestring(p, self.charset) for 
p in params])

    ProgrammingError at /admin/program/session/15/
    ERROR: invalid input syntax for integer: "" SELECT 
"program_session"."id","program_session"."title","program_session"."short_title","program_session"."description","program_session"."start_id","program_session"."track_id","program_session"."duration"
 FROM "program_session" INNER JOIN "program_timedivision" AS 
"program_session__start" ON "program_session"."start_id" = 
"program_session__start"."id" WHERE ("program_session__start"."id" ILIKE '40' 
AND "program_session"."track_id" = '')

My wild guess here is that this happens because track_id is the primary key
and thus expects an integer value; had I made the track name its
primary key it might've worked (?).  Anyway, if I want to make that
change at this point, I don't know how to do so without losing my
valuable data.  Any help you can offer me would be very much
appreciated.

Thanks,

P.S. I've seen hints elsewhere that you also need blank=True, but that had
no effect for me.
-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to