Changes between Version 5 and Version 6 of RemovingTheMagic
- Timestamp:
- Dec 6, 2005, 11:30:30 PM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
RemovingTheMagic
v5 v6 26 26 last_name = models.CharField(maxlength=30) 27 27 28 def _get_full_name(self):29 return "%s %s" % (self.first_name, self.last_name)30 full_name = property(_get_full_name)28 def _get_full_name(self): 29 return "%s %s" % (self.first_name, self.last_name) 30 full_name = property(_get_full_name) 31 31 }}} 32 32 … … 103 103 last_name = models.CharField(maxlength=30) 104 104 105 def save(self):106 self.do_something()107 super(Person, self).save(self) # Call the "real" save() method.108 self.do_something_else()105 def save(self): 106 self.do_something() 107 super(Person, self).save(self) # Call the "real" save() method. 108 self.do_something_else() 109 109 }}} 110 110 … … 117 117 last_name = models.CharField(maxlength=30) 118 118 119 def save(self):120 if datetime.date.today() > datetime.date(2005, 1, 1):121 super(Person, self).save(self) # Call the "real" save() method.122 else:123 # Don't save.124 pass119 def save(self): 120 if datetime.date.today() > datetime.date(2005, 1, 1): 121 super(Person, self).save(self) # Call the "real" save() method. 122 else: 123 # Don't save. 124 pass 125 125 }}} 126 126