Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##
- ## Can somebody explain why this is happening
- ## and/or a workaround for this craziness?
- ##
- ## iPython Shell 1
- from django.contrib.auth.models import User
- ## iPython Shell 2
- from django.contrib.auth.models import User
- ## iPython Shell 1
- a = User()
- a.username = 'foo'
- a.email = 'foo@localhost.com'
- a.save()
- print a.id #1
- ## iPython Shell 2
- print User.objects.get(pk=1).id #1
- ## iPython Shell 1
- b = User()
- b.username = 'bar'
- b.email = 'foo@localhost.com'
- b.save()
- print b.id #2
- ## iPython Shell 2
- print User.objects.get(pk=2) #Raises User.DoesNotExist
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement