Changes between Initial Version and Version 2 of Ticket #16356
- Timestamp:
- Sep 26, 2016, 10:15:58 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #16356
- Property Resolution → invalid
- Property Status new → closed
-
Ticket #16356 – Description
initial v2 6 6 7 7 The classes would be: 8 8 {{{ 9 9 class Owner(models.Model): 10 10 address = models.ForeignKey(Address) … … 20 20 street = models.CharField(max_length=100) 21 21 number = models.IntegerField(default=0) 22 22 }}} 23 23 24 24 This is the correct mapping following the logic of object-orientation, but this mapping does not allow remove related objects by CASCADE. 25 25 According to the Django doc, the mapping is inverse: 26 26 {{{ 27 27 class Owner(models.Model): 28 28 #other fields … … 36 36 owner = models.ForeignKey(Owner) 37 37 house = models.ForeignKey(House) 38 38 }}} 39 39 40 40 The big problem is that this mapping in the form of owner the address form is shown with a select of houses, and in the form of owner is shown a form address with a select of owners.