Hi all! I'm new to Django (been a Zope developer for years), and I'm
working on an app to front-end a legacy postgres database, and running
into a few snags.

The database uses sequences for all of the PKs, and when I attempt to
insert a new record:

i = Person(name="Rick", facility_id=123)
i.save()

I get back:

IntegrityError: ERROR:  null value in column "id" violates not-null
constraint

It seems the ORM is automatically inserting 'null' in the id column on
insert, rather than not referencing it at all, and I can't figure out
how to stop that behavior. I'm sure this is a common problem, but I
can't find any answers via search.

TIA

Rick

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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