#16767: get_or_create does not raise error even though i didn't give a primary key to it ----------------------------+---------------------------------------------- Reporter: haandol | Owner: nobody Type: Bug | Status: new Milestone: | Component: Database layer (models, ORM) Version: 1.3 | Severity: Normal Keywords: model, | Triage Stage: Unreviewed get_or_create | Easy pickings: 0 Has patch: 0 | UI/UX: 0 | ----------------------------+---------------------------------------------- here is the example model {{{#!python class User(models.Model): id = models.CharField(max_length=128, primary_key=True) email = models.EmailField(unique=True) created = models.DateField(auto_now_add=True) }}}
and here is view code {{{#!python user, isnew = User.objects.get_or_create(email='setsquaret...@gmail.com') }}} I expected the prev view code raises a kind of database error, but it added a record on the database with 'empty primary key' normally. -- Ticket URL: <https://code.djangoproject.com/ticket/16767> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.