mirror of
https://github.com/django/django.git
synced 2025-03-26 09:10:50 +00:00
[1.6.x] Fixed #22978 -- Removed a USA-centric example that didn't add much.
Backport of 9f18b6bcb0 from master
This commit is contained in:
parent
837cad0f62
commit
d8f7e00708
@ -684,9 +684,6 @@ For example, this model has a few custom methods::
|
|||||||
first_name = models.CharField(max_length=50)
|
first_name = models.CharField(max_length=50)
|
||||||
last_name = models.CharField(max_length=50)
|
last_name = models.CharField(max_length=50)
|
||||||
birth_date = models.DateField()
|
birth_date = models.DateField()
|
||||||
address = models.CharField(max_length=100)
|
|
||||||
city = models.CharField(max_length=50)
|
|
||||||
state = models.CharField(max_length=2) # yes, this is America-centric
|
|
||||||
|
|
||||||
def baby_boomer_status(self):
|
def baby_boomer_status(self):
|
||||||
"Returns the person's baby-boomer status."
|
"Returns the person's baby-boomer status."
|
||||||
@ -698,10 +695,6 @@ For example, this model has a few custom methods::
|
|||||||
else:
|
else:
|
||||||
return "Post-boomer"
|
return "Post-boomer"
|
||||||
|
|
||||||
def is_midwestern(self):
|
|
||||||
"Returns True if this person is from the Midwest."
|
|
||||||
return self.state in ('IL', 'WI', 'MI', 'IN', 'OH', 'IA', 'MO')
|
|
||||||
|
|
||||||
def _get_full_name(self):
|
def _get_full_name(self):
|
||||||
"Returns the person's full name."
|
"Returns the person's full name."
|
||||||
return '%s %s' % (self.first_name, self.last_name)
|
return '%s %s' % (self.first_name, self.last_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user