Anonymous avatar Anonymous committed e3bacea

Removed SQLAlchemy 0.5-dev dependency for release version.

Comments (0)

Files changed (4)

 - Werkzeug*
 - Jinja2*
 - A database (MySQL, SQLite or PostgreSQL and others are supported)
-- SQLAlchemy 0.5 [revision>=5491] or higher*
+- SQLAlchemy 0.5
 - simplejson* [included in Python 2.6 and higher]
 - html5lib*
 - pytz*
     :copyright: 2007-2008 by Armin Ronacher.
     :license: BSD, see LICENSE for more details.
 """
-__version__ = '0.1-dev'
+__version__ = '0.1'
 __url__ = 'http://zine.pocoo.org/'
 
 
     'id':               users.c.user_id,
     'display_name':     db.synonym('_display_name', map_column=True),
     'posts':            db.dynamic_loader(Post, backref='author',
-                                          query_class=PostQuery,
                                           cascade='all, delete, delete-orphan'),
     'comments':         db.dynamic_loader(Comment, backref='user',
                                           cascade='all, delete, delete-orphan'),
 db.mapper(Group, groups, properties={
     'id':               groups.c.group_id,
     'users':            db.dynamic_loader(User, backref='groups',
-                                          query_class=UserQuery,
                                           secondary=group_users),
     '_privileges':      db.relation(_Privilege, lazy=True,
                                     secondary=group_privileges,
 })
 db.mapper(Category, categories, properties={
     'id':               categories.c.category_id,
-    'posts':            db.dynamic_loader(Post, secondary=post_categories,
-                                          query_class=PostQuery)
+    'posts':            db.dynamic_loader(Post, secondary=post_categories)
 }, order_by=categories.c.name)
 db.mapper(Comment, comments, properties={
     'id':           comments.c.comment_id,
 })
 db.mapper(Tag, tags, properties={
     'id':           tags.c.tag_id,
-    'posts':        db.dynamic_loader(Post, secondary=post_tags,
-                                      query_class=PostQuery)
+    'posts':        db.dynamic_loader(Post, secondary=post_tags)
 }, order_by=tags.c.name)
 db.mapper(Post, posts, properties={
     'id':               posts.c.post_id,

zine/views/blog.py

     :URL endpoint: ``blog/show_category``
     """
     category = Category.query.filter_by(slug=slug).first(True)
-    data = category.posts.published().get_list(page=page,
-                                               endpoint='blog/show_category',
-                                               url_args=dict(slug=slug))
+    data = Post.query.filter(Post.categories.contains(category)) \
+               .published().get_list(page=page, endpoint='blog/show_category',
+                                     url_args=dict(slug=slug))
 
     add_link('alternate', url_for('blog/atom_feed', category=slug),
              'application/atom+xml', _(u'All posts in category %s') % category.name)
     :URL endpoint: ``blog/show_tag``
     """
     tag = Tag.query.filter_by(slug=slug).first(True)
-    data = tag.posts.published().get_list(page=page, endpoint='blog/show_tag',
-                                          url_args=dict(slug=slug))
+    data = Post.query.filter(Post.tags.contains(tag)) \
+               .published().get_list(page=page, endpoint='blog/show_tag',
+                                     url_args=dict(slug=slug))
 
     add_link('alternate', url_for('blog/atom_feed', tag=slug),
              'application/atom+xml', _(u'All posts tagged %s') % tag.name)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.