Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(6)  |  Derive(0)  |  Import(0)

src/b/o/boar-HEAD/boar/articles/feeds.py   boar(Download)
    def items(self):
        qs = Article.objects.filter(published=True)
        if self.featured:
            qs = qs.filter(featured=True)
        return self._add_podcast_metadata(qs[:ITEMS])
    def items(self, obj):
        qs = Article.objects.filter(published=True, section=obj)
        if self.featured:
            qs = qs.filter(featured=True)
        return self._add_podcast_metadata(qs[:ITEMS])
    def items(self, obj):
        return self._add_podcast_metadata(
            Article.objects.filter(
                published=True, 
                section=obj['section'], 

src/b/o/boar-HEAD/boar/articles/templatetags/articles.py   boar(Download)
def section_block(context, section, heading='3', articles=None):
    if not isinstance(section, Section):
        section = Section.objects.get(slug=section)
    if articles is None:
        articles = Article.objects.filter(published=True)

src/b/o/boar-HEAD/boar/articles/views.py   boar(Download)
def home(request):
    # Featured articles
    published = Article.objects.filter(published=True)
    news = published.filter(section__slug='news')
    featured = list(news.filter(featured=True).exclude(image=None)[:1])

src/b/o/boar-HEAD/boar/accounts/admin.py   boar(Download)
                            profile.save()
                    # Articles
                    for a in Article.objects.filter(authors=victim):
                        a.authors.remove(victim)
                        if not a.authors.filter(pk=user.pk):