Trying to migrate from 1.1 to 1.3. My app is broken at the moment
because I'm not getting id's out of saved objects. I'm using
Postgresql/psycopg2.

I'm able to demonstrate in an ipython shell:

In [1]: import django

In [2]: django.get_version()
Out[2]: u'1.1.4 SVN-15632'

In [3]: u = User.objects.all()[0]

In [4]: ut = Utility(created_by=u, modified_by=u, name="Test1",
abbr="T1")

In [5]: ut.save()

In [6]: ut.id
Out[6]: 7L

I quit this session, and switch to 1.3, the do the same thing:

In [1]: import django

In [2]: django.get_version()
Out[2]: u'1.3 SVN-15912'

In [3]: u = User.objects.all()[0]

In [4]: ut = Utility(created_by=u, modified_by=u, name="Test2",
abbr="T2")

In [5]: ut.save()

In [6]: ut.id

In [7]: ut.id == None
Out[7]: True

And.. if I hope over to my psql shell, I can see that both were
created:

er-ca=# select * from er_utility where id > 6;
 id | modified_by_id | created_by_id |          modified_on
|          created_on           | name  | abbr | contact_id
----+----------------+---------------+-------------------------------
+-------------------------------+-------+------+------------
  7 |             11 |            11 | 2011-03-24 12:02:04.341317-07 |
2011-03-24 12:02:04.341004-07 | Test1 | T1   |
  8 |             11 |            11 | 2011-03-24 12:03:10.472508-07 |
2011-03-24 12:03:10.472456-07 | Test2 | T2   |


Any ideas what is going on here?

-- 
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.

Reply via email to