Hi guys, I have some issue with model multi inheritance in Django's ORM. I'm trying to create a ChildModel(ParentModelA, ParentModelB). When I create a ChildModel register, Django's ORM creates backstage both ParentModelA and ParentModelB registers. The odd thing is that both parent registers got the same id, therefore in the ChildModel register, I got two ptrs with the same int value.
-- I used the next algorithm to test if it is a threat to my application:
- Manually create a register in ParentModelB (using the next ID that ParentModelA would create for it's new register)
- Create a ChildModel
- When saving the register, Django uses the ParentModelA next ID to create the register in ParentModelA, BUT ALSO uses that same ID to create the register in ParentModelB. This means that the register that I created in the first step was overwritten.
This is really awful for me, but I don't know if this behavior could be customized.
Thanks in advance for your help
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/97b90d85-65a9-4ac1-b816-10b4d56161c7%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment