Changes between Initial Version and Version 1 of Ticket #28268, comment 2
- Timestamp:
- Jun 3, 2017, 12:00:22 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #28268, comment 2
initial v1 20 20 21 21 >>> model = ModelA() 22 >>> model.related_count() 23 0 # calls first time 24 >>> model.related_count() 25 0 # does not call 26 22 27 >>> rel = Related() 23 28 >>> rel.model = model … … 27 32 >>> model.related_count() 28 33 1 # calls first time 34 >>> model.related_count() 35 1 # does not call 29 36 30 37 >>> model.related_content() 31 38 Text # calls first time 39 >>> model.related_content() 40 Text # does not call 32 41 33 42 >>> rel.title = "New Text" 34 43 >>> rel.save() 35 44 >>> model.related_content() 36 New Text # calls, because rel changed 37 45 New Text # calls first time, because rel changed 46 >>> model.related_content() 47 New Text # does not call 38 48 >>> model.related_count() 39 1 # does not call, because nothing was added49 1 # calls again, because rel changed 40 50 41 51 >>> rel.delete() 42 52 >>> model.related_count() 43 53 0 # calls, because related model removed 54 >>> model.related_content() 55 # calls, return nothing 44 56 }}} 45 57