Specify a manager for the Admin

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
class Article(models.Model):
	site = models.ForeignKey(Site)
	title = models.CharField(max_length=100)
	body = models.TextField()
	pub_date = models.DateTimeField()
	
	class Admin:
		#  In this example, the Admin's object list will show *only* Articles
		#  which are related to the current Site.
		#  However, you could specify any Manager you like:
		#  manager = MyCustomManager()
		from django.contrib.sites.managers import CurrentSiteManager
		manager = CurrentSiteManager()
	

Comments

(Forgotten your password?)

You may use Markdown syntax here, but raw HTML will be removed.