Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pyramid_formalchemy/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
except ImportError:
import json

try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict


class Session(object):
"""A abstract class to implement other backend than SA"""
def add(self, record):
Expand Down Expand Up @@ -106,7 +112,7 @@ def models(self, **kwargs):
if has_permission('view', obj, request) or not hasattr(obj, '__acl__'):
models.append(obj)

results = {}
results = OrderedDict() # preserve order of models
for m in models:
if request.format == 'html':
url = request.fa_url(m.__name__)
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys

from setuptools import setup, find_packages

Expand All @@ -8,8 +9,10 @@

requires = ['pyramid>=1.1', 'WebError', 'FormAlchemy>=1.3.8', 'Babel',
'zope.component']
if sys.version_info < (2, 7):
requires.append('ordereddict')

version = '0.4.4dev'
version = '0.4.4dev2'

setup(name='pyramid_formalchemy',
version=version,
Expand Down