Changes between Initial Version and Version 1 of Ticket #10075
- Timestamp:
- Jan 20, 2009, 3:06:54 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #10075 – Description
initial v1 1 1 I have these three models: 2 2 3 {{{ 3 4 class Address(models.Model): 4 5 name = models.CharField(max_length=100) … … 28 29 related_name = "addresses", 29 30 ) 31 }}} 30 32 31 33 When i try to add/edit an organization and add one address i've got this error: 32 34 35 {{{ 33 36 " ValueError: Cannot assign None: "OrganizationAddress.address_ptr" does not allow null values. " 37 }}} 34 38 35 I've tried to understand the problem (because it happened since one day to another..) and i've found that the problem was born after the django commit of the changeset 9664.39 I've tried to understand the problem (because it happened since one day to another..) and i've found that the problem was born after the django commit of the changeset [9664] 36 40 37 41 This is the "incriminated code" of changeset: 42 {{{ 38 43 488 if fk_attname == self._pk_field.attname: 39 44 489 exclude = [self._pk_field.name] 40 45 490 else: 41 46 491 exclude = [] 47 }}} 42 48 43 49 I have "organization_id" in the fk_attname e "address_ptr" in the self._pk_field.attname and so the primary_key wasn't insert in the exclude list. … … 45 51 Below a code portion to test the problem. 46 52 47 """ 53 {{{ 48 54 from django.forms.models import inlineformset_factory 49 55 from my_apps.models import Organization, Address, OrganizationAddress … … 64 70 formset.is_valid() 65 71 formset.save() 66 """ 72 }}} 67 73 68 74 Sorry for my english.