def get_links_with_tag(self, tag): tags = Tag.objects.filter(value=tagStr) collection = LinkCollection() for item in tags: link = LinkbotLink() link.url = item.link.url collection.add_link(link) return collection
def recent(self, count=5): links = Link.objects.all()[:count] collection = LinkCollection() for item in links: link = LinkbotLink() link.url = item.url collection.add_link(link) return collection