Форум сайта python.su
urlpatterns = patterns('',
...
(r'^tag/ (?P<tag>[^/]+)/$', 'tagging.views.tagged_object_list'),
)
class BlogPost(models.Model):
...
tags = TagField ()
{% load tagging_tags cache %}
{% cache 20 tags %}
{% tag_cloud_for_model blog.BlogPost as tags with steps=300 distribution=log min_count=2 %}
{% for tag in tags %}
<a href="/news/tag/{{tag.slug}}/" style="font-size: {{tag.font_size|add:"60"}}%;" title="{{ tag.count }}">
{{tag.name}}
</a>
{% endfor %}
{% endcache %}
self.ppmenu_xml = """
<popup name="button3">
<menuitem name="Обновить цитаты" verb="Reload" stockid="gtk-refresh" />
<menuitem name="O программе" verb="About" stockid="gtk-about" />
</popup>
"""
self.ppmenu_verbs = [
("About", self.on_ppm_about),
("Reload", self.reload_quote)
]
self.applet.setup_menu(self.ppmenu_xml, self.ppmenu_verbs, None)
from __future__ import unicode_literals, print_function # anything?
def test():
"""
>>> 1+1
2
"""
pass
import doctest
doctest.testmod()
...>"c:\Program Files (x86)\IronPython 2.6\ipy.exe" test.py
**********************************************************************
File "test.py", line 5, in __main__.test
Failed example:
1+1
Exception raised:
Traceback (most recent call last):
File "c:\Program Files (x86)\IronPython 2.6\Lib\doctest.py", line 1240, in
_DocTestRunner__run
exec compile(example.source, filename, "single",
ValueError: unrecognized flags
**********************************************************************
1 items had failures:
1 of 1 in __main__.test
***Test Failed*** 1 failures.