mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
magic-removal: related classes methods now added
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1650 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -5,6 +5,7 @@ Any method you add to a model will be available to instances.
|
||||
"""
|
||||
|
||||
from django.db import models
|
||||
import datetime
|
||||
|
||||
class Article(models.Model):
|
||||
headline = models.CharField(maxlength=100)
|
||||
@@ -17,7 +18,7 @@ class Article(models.Model):
|
||||
return self.pub_date == datetime.date.today()
|
||||
|
||||
def get_articles_from_same_day_1(self):
|
||||
return self.objects.get_list(id__ne=self.id, pub_date__exact=self.pub_date)
|
||||
return Article.objects.get_list(id__ne=self.id, pub_date__exact=self.pub_date)
|
||||
|
||||
def get_articles_from_same_day_2(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user