Commit 5ea689a3 authored by Arthur Lutz's avatar Arthur Lutz
Browse files

autopep8

parent d269f913a0a6
......@@ -18,10 +18,10 @@ classifiers = [
'Framework :: CubicWeb',
'Programming Language :: Python',
'Programming Language :: JavaScript',
]
]
__depends__ = {'cubicweb': '>= 3.19.0',
'six': '>= 1.4.0',}
'six': '>= 1.4.0', }
__recommends__ = {'cubicweb-tag': None,
'cubicweb-preview': None,
'cubicweb-comment': '>= 1.6.3',
......@@ -40,6 +40,7 @@ from glob import glob
THIS_CUBE_DIR = join('share', 'cubicweb', 'cubes', modname)
def listdir(dirpath):
return [join(dirpath, fname) for fname in _listdir(dirpath)
if fname[0] != '.' and not fname.endswith('.pyc')
......@@ -49,7 +50,7 @@ def listdir(dirpath):
data_files = [
# common files
[THIS_CUBE_DIR, [fname for fname in glob('*.py') if fname != 'setup.py']],
]
]
# check for possible extended cube layout
for dirname in ('entities', 'views', 'sobjects', 'hooks', 'schema',
'data', 'i18n', 'migration', 'wdoc'):
......
......@@ -13,6 +13,7 @@ from cubicweb.entities import AnyEntity, fetch_config
from cubicweb.view import EntityAdapter
from cubicweb.predicates import is_instance
class BlogIFeedAdapter(EntityAdapter):
__regid__ = 'IFeed'
__select__ = is_instance('Blog', 'MicroBlog')
......@@ -26,6 +27,7 @@ class BlogIFeedAdapter(EntityAdapter):
return self._cw.build_url(rql=rql % self.entity.eid, vid='rss',
vtitle=self.entity.dc_title())
class BlogISiocContainerAdapter(EntityAdapter):
__regid__ = 'ISIOCContainer'
__select__ = is_instance('Blog')
......@@ -40,7 +42,8 @@ class BlogISiocContainerAdapter(EntityAdapter):
class BlogEntry(AnyEntity):
"""customized class for BlogEntry entities"""
__regid__ = 'BlogEntry'
fetch_attrs, cw_fetch_order = fetch_config(['creation_date', 'title'], order='DESC')
fetch_attrs, cw_fetch_order = fetch_config(
['creation_date', 'title'], order='DESC')
def dc_title(self):
return self.title
......@@ -56,6 +59,7 @@ class BlogEntry(AnyEntity):
break
return self._cw.format_date(dc_date, date_format=date_format)
class BlogEntryICalendarableAdapter(EntityAdapter):
__regid__ = 'ICalendarable'
__select__ = is_instance('BlogEntry')
......@@ -104,4 +108,3 @@ class BlogEntryISiocItemAdapter(EntityAdapter):
def isioc_topics(self):
# XXX link to tags, folders?
return []
from cubicweb.predicates import is_instance, is_in_state
from cubicweb.sobjects.notification import NotificationView, StatusChangeMixIn
class BlogEntryPublishedView(StatusChangeMixIn, NotificationView):
"""get notified from published blogs"""
__select__ = is_instance('BlogEntry',) & is_in_state('published')
......
change_relation_props('BlogEntry', 'entry_of', 'Blog', commit=True, cardinality='**')
change_relation_props('BlogEntry', 'entry_of', 'Blog',
commit=True, cardinality='**')
......@@ -13,4 +13,3 @@ published = bwf.add_state(_('published'))
publish = bwf.add_transition(_('publish'), draft, published,
('managers', 'owners'))
......@@ -10,7 +10,9 @@ from cubicweb.schema import WorkflowableEntityType, ERQLExpression
class Blog(EntityType):
title = String(maxsize=50, required=True)
description = RichString()
rss_url = String(maxsize=128, description=_('blog\'s rss url (useful for when using external site such as feedburner)'))
rss_url = String(maxsize=128, description=_(
'blog\'s rss url (useful for when using external site such as feedburner)'))
class BlogEntry(WorkflowableEntityType):
__permissions__ = {
......@@ -18,35 +20,39 @@ class BlogEntry(WorkflowableEntityType):
'add': ('managers', 'users'),
'update': ('managers', 'owners'),
'delete': ('managers', 'owners')
}
}
title = String(required=True, fulltextindexed=True, maxsize=256)
content = RichString(required=True, fulltextindexed=True)
entry_of = SubjectRelation('Blog')
same_as = SubjectRelation('ExternalUri')
class MicroBlog(EntityType):
title = String(maxsize=50, required=True)
description = RichString()
class MicroBlogEntry(EntityType):
__permissions__ = {
'read': ('managers', 'users'),
'add': ('managers', 'users'),
'update': ('managers', 'owners'),
'delete': ('managers', 'owners')
}
}
content = RichString(required=True, fulltextindexed=True)
entry_of = SubjectRelation('MicroBlog')
same_as = SubjectRelation('ExternalUri')
class UserAccount(EntityType):
name = String(required=True) # see foaf:accountName
name = String(required=True) # see foaf:accountName
class has_creator(RelationDefinition):
subject = ('BlogEntry', 'MicroBlogEntry')
object = 'UserAccount'
class has_avatar(RelationDefinition):
subject = 'UserAccount'
object = 'ExternalUri'
......@@ -27,10 +27,10 @@ import sys
import shutil
try:
from os.path import exists, join, walk, dirname
except ImportError: #PY3
except ImportError: # PY3
from os.path import exists, join, dirname
from os import walk
try:
if os.environ.get('NO_SETUPTOOLS'):
raise ImportError() # do as there is no setuptools
......@@ -155,6 +155,7 @@ class MyInstallLib(install_lib.install_lib):
"""extend install_lib command to handle package __init__.py and
include_dirs variable if necessary
"""
def run(self):
"""overridden from install_lib class"""
install_lib.install_lib.run(self)
......@@ -172,6 +173,7 @@ if USE_SETUPTOOLS:
# overwrite InstallData to use sys.prefix instead of the egg directory
class MyInstallData(old_install_data):
"""A class that manages data files installation"""
def run(self):
_old_install_dir = self.install_dir
if self.install_dir.endswith('egg'):
......
......@@ -26,16 +26,19 @@ try:
except ImportError:
DataFeedParser = None
def get_subject(g, pred, obj):
subjects = list(g.subjects(pred, obj))
assert len(subjects) == 1
return subjects[0]
def get_object(g, subj, pred):
objects = list(g.objects(subj, pred))
assert len(objects) == 1
return objects[0]
def parse_blogpost_sioc(url):
g = rdflib.ConjunctiveGraph()
g.parse(url)
......@@ -45,9 +48,9 @@ def parse_blogpost_sioc(url):
item['content'] = unicode(get_object(g, post, SIOC.content))
yield item
format_map = {'application/xhtml+xml':u'text/html',
'text/html':u'text/html',
'text/plain':u'text/plain',
format_map = {'application/xhtml+xml': u'text/html',
'text/html': u'text/html',
'text/plain': u'text/plain',
}
IMG_SPIES = ['http://feeds.feedburner.com',
......@@ -57,6 +60,7 @@ IMG_SPIES = ['http://feeds.feedburner.com',
'http://stats.wordpress.com/',
]
def is_img_spy(node):
if node.tag != 'img':
return False
......@@ -65,12 +69,14 @@ def is_img_spy(node):
return True
return False
def is_tweetmeme_spy(node):
href = node.get('href')
if href and href.startswith('http://api.tweetmeme.com/share'):
return True
return False
def remove_content_spies(content):
root = fromstring(content)
if is_img_spy(root):
......@@ -85,6 +91,7 @@ def remove_content_spies(content):
anchor.drop_tree()
return unicode(tostring(root))
def parse_blogpost_rss(url):
data = feedparser.parse(url)
feed = data.feed
......@@ -102,7 +109,7 @@ def parse_blogpost_rss(url):
content = entry.summary_detail.value
mimetype = entry.summary_detail.type
else:
content = u''#XXX entry.description?
content = u'' # XXX entry.description?
mimetype = u'text/plain'
if mimetype == u'text/html':
content = remove_content_spies(content)
......@@ -123,6 +130,7 @@ def parse_blogpost_rss(url):
item['cwuri'] = feed.link
yield item
def parse_microblogpost_rss(url):
feed = feedparser.parse(url)
for entry in feed.entries:
......@@ -143,7 +151,7 @@ def parse_microblogpost_rss(url):
item['content_format'] = format_map.get(mimetype, u'text/plain')
item['creation_date'] = datetime(*entry.date_parsed[:6])
item['modification_date'] = datetime(*entry.date_parsed[:6])
item['author'] = feed.channel.link # true for twitter
item['author'] = feed.channel.link # true for twitter
item['cwuri'] = feed.channel.link
for link in entry.links:
if link.type.startswith('image/') and link.rel == 'image':
......@@ -154,10 +162,12 @@ def parse_microblogpost_rss(url):
item['avatar'] = get_twitter_avatar(screen_name)
yield item
def search_twitter(word):
import urllib2
from simplejson import loads
data = urllib2.urlopen('http://search.twitter.com/search.json?q=%s&rpp=100' % word).read()
data = urllib2.urlopen(
'http://search.twitter.com/search.json?q=%s&rpp=100' % word).read()
results = loads(data)
# process results
# print results
......@@ -165,11 +175,13 @@ def search_twitter(word):
AVATAR_CACHE = {}
def get_twitter_avatar(screen_name):
if screen_name not in AVATAR_CACHE:
from urllib2 import urlopen
import simplejson
data = urlopen('http://api.twitter.com/1/users/show.json?screen_name=%s' % screen_name).read()
data = urlopen(
'http://api.twitter.com/1/users/show.json?screen_name=%s' % screen_name).read()
user = simplejson.loads(data)
AVATAR_CACHE[screen_name] = user['profile_image_url']
return AVATAR_CACHE[screen_name]
......@@ -180,17 +192,17 @@ if DataFeedParser is not None:
entity_type = 'BlogEntry'
def process(self, url):
stats = {'update':0, 'creation':0}
stats = {'update': 0, 'creation': 0}
for item in self.parse(url):
author = item.pop('author', None)
avatar = item.pop('avatar', None)
euri = self.sget_entity('ExternalUri', uri=item.pop('uri'))
if euri.same_as:
#sys.stdout.write('.')
# sys.stdout.write('.')
stats['update'] += 1
post = self.update_blogpost(euri.same_as[0], item)
else:
#sys.stdout.write('+')
# sys.stdout.write('+')
stats['creation'] += 1
post = self.create_blogpost(item, euri)
if author:
......@@ -199,7 +211,7 @@ if DataFeedParser is not None:
if avatar:
auri = self.sget_entity('ExternalUri', uri=avatar)
self.sget_relation(account.eid, 'has_avatar', auri.eid)
#sys.stdout.flush()
# sys.stdout.flush()
return stats
def create_blogpost(self, item, uri):
......
from logilab.common.testlib import unittest_main
from cubicweb.devtools.testlib import AutomaticWebTest
class AutomaticWebTest(AutomaticWebTest):
def to_test_etypes(self):
......
......@@ -11,19 +11,23 @@ class BlogTestsCubicWebTC(CubicWebTC):
with self.admin_access.client_cnx() as cnx:
cubicweb_blog = cnx.create_entity('Blog', title=u'cubicweb',
description=u"cubicweb c'est beau")
blog_entry_1 = cnx.create_entity('BlogEntry', title=u"hop", content=u"cubicweb hop")
blog_entry_1 = cnx.create_entity(
'BlogEntry', title=u"hop", content=u"cubicweb hop")
blog_entry_1.cw_set(entry_of=cubicweb_blog)
blog_entry_2 = cnx.create_entity('BlogEntry', title=u"yes", content=u"cubicweb yes")
blog_entry_2 = cnx.create_entity(
'BlogEntry', title=u"yes", content=u"cubicweb yes")
blog_entry_2.cw_set(entry_of=cubicweb_blog)
self.assertEqual(len(MAILBOX), 0)
cnx.commit()
self.assertEqual(len(MAILBOX), 0)
blog_entry_1.cw_adapt_to('IWorkflowable').fire_transition('publish')
blog_entry_1.cw_adapt_to(
'IWorkflowable').fire_transition('publish')
cnx.commit()
self.assertEqual(len(MAILBOX), 1)
mail = MAILBOX[0]
self.assertEqual(mail.subject, '[data] hop')
blog_entry_2.cw_adapt_to('IWorkflowable').fire_transition('publish')
blog_entry_2.cw_adapt_to(
'IWorkflowable').fire_transition('publish')
cnx.commit()
self.assertEqual(len(MAILBOX), 2)
mail = MAILBOX[1]
......@@ -51,7 +55,6 @@ tutu
self.assertEqual(xml.count("toto"), 0)
self.assertEqual(xml.count("tutu"), content.count("tutu"))
def test_prevnext(self):
with self.admin_access.client_cnx() as cnx:
e1 = cnx.create_entity('BlogEntry', title=u'a', content=u'a')
......
......@@ -3,8 +3,10 @@ from cubicweb.view import EntityAdapter
from cubicweb.web.views import ibreadcrumbs
from cubicweb.web.views.autoform import AutomaticEntityForm
class BlogEntryIBreadCrumbsAdapter(ibreadcrumbs.IBreadCrumbsAdapter):
__select__ = is_instance('BlogEntry', 'MicroBlogEntry')
def parent_entity(self):
return self.entity.entry_of and self.entity.entry_of[0] or None
......@@ -34,7 +36,7 @@ class BlogEntryIPrevNextAdapter(EntityAdapter):
rset = self._cw.execute(rql % (order, operator),
{'eid': self.entity.eid})
if rset:
return rset.get_entity(0,0)
return rset.get_entity(0, 0)
def registration_callback(vreg):
......@@ -63,6 +65,7 @@ def registration_callback(vreg):
if 'preview' in loaded_cubes:
from cubes.preview.views.forms import PreviewFormMixin
class PreviewAutomaticEntityForm(PreviewFormMixin, AutomaticEntityForm):
preview_mode = 'inline'
__select__ = AutomaticEntityForm.__select__ & is_instance('Blog', 'BlogEntry',
......
......@@ -48,7 +48,8 @@ class BlogPrimaryView(primary.PrimaryView):
class SubscribeToBlogComponent(component.EntityCtxComponent):
__regid__ = 'blogsubscribe'
__select__ = component.EntityVComponent.__select__ & is_instance('Blog', 'MicroBlog')
__select__ = component.EntityVComponent.__select__ & is_instance(
'Blog', 'MicroBlog')
context = 'ctxtoolbar'
def render_body(self, w):
......@@ -57,4 +58,3 @@ class SubscribeToBlogComponent(component.EntityCtxComponent):
xml_escape(entity.cw_adapt_to('IFeed').rss_feed_url()),
self._cw.uiprops['RSS_LOGO_16'],
self._cw._(u'subscribe to this blog')))
......@@ -30,7 +30,7 @@ class BlogArchivesBox(component.CtxComponent):
context = 'left'
def render_body(self, w):
#FIXME doesn't handle (yet) multiple blogs
# FIXME doesn't handle (yet) multiple blogs
entity = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0)
rset = entity.related('entry_of', 'object')
self._cw.view('cw.archive.by_date', rset, maxentries=6,
......@@ -50,6 +50,7 @@ class BlogEntryArchivesBox(BlogArchivesBox):
rset=entity.related('entry_of', 'subject'))
box.render_body(w)
class BlogByAuthorBox(component.CtxComponent):
__regid__ = 'blog.archives_by_author'
__select__ = (component.CtxComponent.__select__
......@@ -60,7 +61,7 @@ class BlogByAuthorBox(component.CtxComponent):
context = 'left'
def render_body(self, w):
#FIXME doesn't handle (yet) multiple blogs
# FIXME doesn't handle (yet) multiple blogs
entity = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0)
rset = entity.related('entry_of', 'object')
self._cw.view('cw.archive.by_author', rset,
......@@ -80,6 +81,7 @@ class BlogEntryByAuthorBox(BlogByAuthorBox):
rset=entity.related('entry_of', 'subject'))
box.render_body(w)
class LatestBlogsBox(component.CtxComponent):
"""display a box with latest blogs and rss"""
__regid__ = 'blog.latest_blogs'
......@@ -140,6 +142,7 @@ class LatestBlogsBlogBox(LatestBlogsBox):
'X title T, X creation_date CD, X entry_of B, B eid %(b)s',
{'b': blog.eid})
class LatestBlogsBlogEntryBox(LatestBlogsBox):
"""display a box with latest blogs and rss, filtered for a particular blog
"""
......@@ -151,10 +154,9 @@ class LatestBlogsBlogEntryBox(LatestBlogsBox):
def latest_blogs_rset(self):
blogentry = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0)
#FIXME doesn't handle (yet) multiple blogs
blog = blogentry.related('entry_of', 'subject').get_entity(0,0)
# FIXME doesn't handle (yet) multiple blogs
blog = blogentry.related('entry_of', 'subject').get_entity(0, 0)
return self._cw.execute(
'Any X,T,CD ORDERBY CD DESC LIMIT 5 WHERE '
'X title T, X creation_date CD, X entry_of B, B eid %(b)s',
{'b': blog.eid})
......@@ -34,7 +34,8 @@ _pvs.tag_subject_of(('BlogEntry', 'entry_of', '*'), 'relations')
_afs = uicfg.autoform_section
_afs.tag_subject_of(('BlogEntry', 'entry_of', 'Blog'), 'main', 'attributes')
# blog entries #################################################################
# blog entries ###########################################################
def render_blogentry_title(req, w, entity):
w(u'<h1>%s</h1>' % entity.view('incontext'))
......@@ -82,13 +83,16 @@ class BlogEntryPrimaryView(primary.PrimaryView):
# don't show workflow history for blog entry
class BlogEntryWFHistoryVComponent(workflow.WFHistoryVComponent):
__select__ = workflow.WFHistoryVComponent.__select__ & is_instance('BlogEntry')
__select__ = workflow.WFHistoryVComponent.__select__ & is_instance(
'BlogEntry')
def render(self, w, **kwargs):
pass
class BlogEntrySameETypeListView(baseviews.SameETypeListView):
__select__ = baseviews.SameETypeListView.__select__ & is_instance('BlogEntry')
__select__ = baseviews.SameETypeListView.__select__ & is_instance(
'BlogEntry')
countrql = ('Any COUNT(B) WHERE B is BlogEntry, '
'B creation_date >= %(firstday)s, B creation_date <= %(lastday)s')
item_vid = 'blog'
......@@ -98,7 +102,8 @@ class BlogEntrySameETypeListView(baseviews.SameETypeListView):
super(BlogEntrySameETypeListView, self).call(**kwargs)
# XXX Iirk, IPrevNext
if 'year' in self._cw.form and 'month' in self._cw.form:
self.render_next_previous(int(self._cw.form['year']), int(self._cw.form['month']))
self.render_next_previous(
int(self._cw.form['year']), int(self._cw.form['month']))
def render_next_previous(self, year, month):
if month == 12:
......@@ -110,12 +115,12 @@ class BlogEntrySameETypeListView(baseviews.SameETypeListView):
previousmonth = 12
year = year - 1
else:
previousmonth = month -1
previousmonth = month - 1
self.w(u'<div class="prevnext">')
self.w(u'<span class="previousmonth">%s</span>' \
self.w(u'<span class="previousmonth">%s</span>'
% self.render_link(year, previousmonth,
xml_escape(u'<< ' + self._cw._(u'previous month'))))
self.w(u'<span class="nextmonth">%s</span>' \
self.w(u'<span class="nextmonth">%s</span>'
% self.render_link(year, nextmonth,
xml_escape(self._cw._(u'next month') + u' >>')))
self.w(u'</div>')
......@@ -130,14 +135,16 @@ class BlogEntrySameETypeListView(baseviews.SameETypeListView):
rql = ('Any B, BD ORDERBY BD DESC '
'WHERE B is BlogEntry, B creation_date BD, '
'B creation_date >= "%s", B creation_date <= "%s"' %
(firstday.strftime('%Y-%m-%d'), lastday.strftime('%Y-%m-%d')))
label = u'%s %s [%s]' % (self._cw._(calendar.MONTHNAMES[month-1]), year,
(firstday.strftime('%Y-%m-%d'), lastday.strftime('%Y-%m-%d')))
label = u'%s %s [%s]' % (self._cw._(calendar.MONTHNAMES[month - 1]), year,
nmb_entries)
vtitle = '%s %s' % (display_name(self._cw, 'BlogEntry', 'plural'), label)
vtitle = '%s %s' % (display_name(
self._cw, 'BlogEntry', 'plural'), label)
url = self._cw.build_url('view', rql=rql, vtitle=vtitle,
month=month, year=year)
return u'<a href="%s">%s</a>' % (xml_escape(url), atitle)
class BlogEntryBlogView(EntityView):
__regid__ = 'blog'
__select__ = is_instance('BlogEntry')
......@@ -172,7 +179,7 @@ class BlogEntryPostMetaData(EntityView):
w = reldata.append
schema = self._cw.vreg.schema
if 'comments' in schema and \
'BlogEntry' in schema.rschema('comments').objects():
'BlogEntry' in schema.rschema('comments').objects():
from cubes.comment.entities import subcomments_count
count = subcomments_count(entity)
if count:
......@@ -199,10 +206,10 @@ class BlogNavigation(navigation.PageNavigation):
__select__ = paginated_rset() & sorted_rset() & is_instance('BlogEntry')
def index_display(self, start, stop):
return unicode(int(start / self.page_size)+1)
return unicode(int(start / self.page_size) + 1)
# micro blog entries ###########################################################
# micro blog entries #####################################################
def format_microblog(entity):
if entity.has_creator:
......@@ -232,6 +239,7 @@ def format_microblog(entity):
u'<span class="meta"><a href="%s">%s</a></span>'
u'</div>' % (ablock, content, entity.absolute_url(), entity.creation_date))
class MicroBlogEntryPrimaryView(primary.PrimaryView):
__select__ = primary.PrimaryView.__select__ & is_instance('MicroBlogEntry')
......@@ -240,8 +248,10 @@ class MicroBlogEntryPrimaryView(primary.PrimaryView):
entity = self.cw_rset.get_entity(row, col)
self.w(format_microblog(entity))
class MicroBlogEntrySameETypeListView(baseviews.SameETypeListView):
__select__ = baseviews.SameETypeListView.__select__ & is_instance('MicroBlogEntry')
__select__ = baseviews.SameETypeListView.__select__ & is_instance(
'MicroBlogEntry')
def cell_call(self, row, col):
self._cw.add_css('cubes.blog.css')
......@@ -250,6 +260,7 @@ class MicroBlogEntrySameETypeListView(baseviews.SameETypeListView):
_CLEAN_STYLE_RE = re.compile(r'<style .*?</style>', re.MULTILINE | re.DOTALL)
class BlogEntryRSSItemView(RSSItemView):
__select__ = is_instance('BlogEntry')
......
......@@ -3,6 +3,7 @@ from datetime import datetime
from cubicweb.web.views.urlrewrite import SimpleReqRewriter, rgx
class BlogReqRewriter(SimpleReqRewriter):
rules = [
# links generated by archives by date/author boxes
......@@ -11,7 +12,8 @@ class BlogReqRewriter(SimpleReqRewriter):
)),
(rgx('/(micro)?blog/([0-9]+)/blogentries/([a-z_]+)'),
dict(rql='Any B,BD ORDERBY BD DESC WHERE B creation_date BD, B entry_of BL, BL eid %(eid)s, '
'B created_by U, U login "%(user)s"' % {'eid': r'\2', 'user': r'\3'},
'B created_by U, U login "%(user)s"' % {
'eid': r'\2', 'user': r'\3'},
user=r'\2')),
(rgx('/(micro)?blog/([0-9]+)/blogentries/([0-9]{4})'),
dict(rql='Any B,BD ORDERBY BD DESC WHERE B creation_date BD, B entry_of BL, BL eid %(eid)s'
......@@ -19,13 +21,14 @@ class BlogReqRewriter(SimpleReqRewriter):
)),
(rgx('/(micro)?blog/([0-9]+)/blogentries/([0-9]{4})/([0-9]{2})'),
dict(rql='Any B,BD ORDERBY BD DESC WHERE B creation_date BD, B entry_of BL, BL eid %(eid)s '
'HAVING YEAR(BD)= %(year)s, MONTH(BD)=%(month)s' % {'eid': r'\2', 'year': r'\3', 'month': r'\4'},
'HAVING YEAR(BD)= %(year)s, MONTH(BD)=%(month)s' % {
'eid': r'\2', 'year': r'\3', 'month': r'\4'},
)),
# XXX use or kill
(rgx('/blogentry/([a-z_]+)'),
dict(rql='Any B,BD ORDERBY BD DESC WHERE B is BlogEntry, B creation_date BD, B created_by U, U login "%(user)s"' % {'user': r'\1'},
user = r'\1')),
user=r'\1')),
(rgx('/blogentry/([a-z_]+)\.rss'),
dict(rql='Any B,BD ORDERBY BD DESC LIMIT 20 WHERE B is BlogEntry, B creation_date BD, B created_by U, U login "%(user)s"' % {'user': r'\1'}, vid='rss')),
......@@ -38,4 +41,4 @@ class BlogReqRewriter(SimpleReqRewriter):
'HAVING YEAR(BD) = %(year)s, MONTH(BD) = %(month)s' % {'year': r'\1',
'month': r'\2'})),
]
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment