Changes between Initial Version and Version 1 of Ticket #28268, comment 2


Ignore:
Timestamp:
Jun 3, 2017, 12:00:22 PM (7 years ago)
Author:
Özer Sahin

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28268, comment 2

    initial v1  
    2020
    2121>>> model = ModelA()
     22>>> model.related_count()
     230  # calls first time
     24>>> model.related_count()
     250  # does not call
     26
    2227>>> rel = Related()
    2328>>> rel.model = model
     
    2732>>> model.related_count()
    28331  # calls first time
     34>>> model.related_count()
     351  # does not call
    2936
    3037>>> model.related_content()
    3138Text  # calls first time
     39>>> model.related_content()
     40Text  # does not call
    3241
    3342>>> rel.title = "New Text"
    3443>>> rel.save()
    3544>>> model.related_content()
    36 New Text  # calls, because rel changed
    37 
     45New Text  # calls first time, because rel changed
     46>>> model.related_content()
     47New Text  # does not call
    3848>>> model.related_count()
    39 1  # does not call, because nothing was added
     491  # calls again, because rel changed
    4050
    4151>>> rel.delete()
    4252>>> model.related_count()
    43530  # calls, because related model removed
     54>>> model.related_content()
     55  # calls, return nothing
    4456}}}
    4557
Back to Top