Commits

mitsuhiko  committed e3bacea

Removed SQLAlchemy 0.5-dev dependency for release version.

  • Participants
  • Parent commits 3dd55e1
  • Tags 0.1

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*

File zine/__init__.py

     :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/'
 
 

File zine/models.py

     '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,

File 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)