Пример #1
0
  def _prepare (self):
    if self._tag:
      from tagging.models import Tag, TaggedItem
      tag = Tag.objects.get(name=self._tag)
      lst = TaggedItem.objects.get_by_model (Snippet, tag)
    else:
      # easy way, but capitalization difficulties:
      lst = Snippet.objects.filter (name__in=[p for p in self._pages])

    self._links = [link (o.name, href=o.url, title=o.title) for o in lst]
    #WebSnippet._prepare (self)
    return self # make chainable
Пример #2
0
 def _as_ul (self):
   #lst = [(p,self.__dict__ [slugify(p)]) for p in self.pagelist]
   return ul (li ([link (p, href=o._url, title=o.title) for p,o in self._pagelist]))
Пример #3
0
 def _as_middot (self):
   #dct = self.__dict__
   #lst = [(p,self.__dict__ [slugify(p)]) for p in self.pagelist]
   return '·'.join ([link (p, href=o._url, title=o.title) for p,o in self._pagelist])