Public feed #887750

Unnamed

public python v1 · immutable
Raw Edit
·published 2008-02-01 16:11 UTC
rendered paste body
class SiteData(models.Model):    """    The is only one of these, it's just a hub for data belonging to the entire    site. For example news articles that aren't associated with a Society.    """    name = models.CharField(max_length=50)    news_articles = models.ManyToManyField(NewsArticle,                                           related_name='newsarticle_set',                                           blank=True)    def number_of_news_articles(self):        return self.news_articles.objects.count()    class Meta:        verbose_name_plural = 'Site data'    class Admin:        list_display = ('name', 'number_of_news_articles')