On Thu, Jun 24, 2010 at 5:40 PM, ringemup <ringe...@gmail.com> wrote:
> Upgrading from Django 1.0 to 1.2, I'm suddenly getting errors when > creating objects in the admin form a class that essentially looks like > this: > > class MyObject(models.Model): > name = models.CharField(max_length=50) > other_thing = models.ForeignKey(MyOtherModel, null=False, > blank=True) > > def save(self, *args, **kwargs): > logging.debug('saving here') > if not self.other_thing: > other_thing = MyOtherModel() > other_thing.save() > self.other_thing = other_thing > super(MyObject, self).save(*args, **kwargs) > > Creating a MyObject in the admin and leaving the other_thing field > blank results in the following error: > > Cannot assign None: "MyObject.other_thing" does not allow null values. > There is a ticket open on this: http://code.djangoproject.com/ticket/13776 Karen -- http://tracey.org/kmt/ -- 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.