Skip to content

Commit

Permalink
Merge pull request #1 from paylogic/index-language-columns
Browse files Browse the repository at this point in the history
Index language columns.
  • Loading branch information
spirosikmd committed Sep 11, 2014
2 parents a438bad + ae8094b commit 18b02d0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.egg-info
*.pyc
*.pyo
*.orig
/.tox
/bin
/include
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: python
# command to install dependencies
install:
- pip install python-coveralls
- pip install python-coveralls virtualenv
# # command to run tests
script: python setup.py test
after_success:
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

Unreleased
----------

* Use index=True when declaring language columns to be able to search efficiently on language fields.

1.0.0
-----
Expand Down
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def __init__(self, **kwargs):
setattr(self, key, value)

def __setattr__(self, name, value):
if not name in fields:
if name not in fields:
raise AttributeError("Illegal attribute name {0}".format(name))
super(_Record, self).__setattr__(name, value)

Expand Down
5 changes: 0 additions & 5 deletions traduki/config.py.orig

This file was deleted.

2 changes: 1 addition & 1 deletion traduki/sqla.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def initialize(base, languages, get_current_language_callback, get_language_chai
if attributes is None:
attributes = {}

attributes.update(dict(((lang, Column(UnicodeText, nullable=True)) for lang in languages)))
attributes.update(dict(((lang, Column(UnicodeText, nullable=True, index=True)) for lang in languages)))

Translation = type('Translation', (TranslationMixin, base), attributes)

Expand Down

0 comments on commit 18b02d0

Please sign in to comment.