Commits

David Paccoud committed e820afe

Added database translation

Comments (0)

Files changed (7)

core/__init__.py

Empty file added.
+from datatrans.utils import register
+from basic.blog.models import Category, Post
+
+
+class CategoryTranslation(object):
+    fields = ('title', )
+
+
+class PostTranslation(object):
+    fields = ('title', 'body', 'tease')
+
+
+register(Category, CategoryTranslation)
+register(Post, PostTranslation)
+"""
+This file demonstrates two different styles of tests (one doctest and one
+unittest). These will both pass when you run "manage.py test".
+
+Replace these with more appropriate tests for your application.
+"""
+
+from django.test import TestCase
+
+class SimpleTest(TestCase):
+    def test_basic_addition(self):
+        """
+        Tests that 1 + 1 always equals 2.
+        """
+        self.failUnlessEqual(1 + 1, 2)
+
+__test__ = {"doctest": """
+Another way to test that 1 + 1 is equal to 2.
+
+>>> 1 + 1 == 2
+True
+"""}
+
+# Create your views here.
 Markdown==2.0.3
 distribute==0.6.15
 -e git+https://github.com/nathanborror/django-basic-apps.git@84f5ebdcc0d4c54b973d89634ae2135822c4d26f#egg=django_basic_apps-dev
+-e git+https://github.com/citylive/django-datatrans.git@fb7a7f6aff0c7aca64a12a5a9c0902f1bf19e76e#egg=django_datatrans-dev
 django-tagging==0.3.1
 psycopg2==2.4
 wsgiref==0.1.2
 # http://www.i18nguy.com/unicode/language-identifiers.html
 LANGUAGE_CODE = 'fr-fr'
 
+_ = lambda s: s
+LANGUAGES = (
+    ('fr', _('French')),
+    ('en', _('English')),
+)
+
 SITE_ID = 1
 
 # If you set this to False, Django will make some optimizations so as not
     'basic.comments',
     'basic.tools',
     'tagging',
+    'datatrans',
+    'core',
 )
 urlpatterns = patterns('',
     (r'^admin/', include(admin.site.urls)),
     (r'^comments/', include('basic.comments.urls')),
+    (r'^trans/', include('datatrans.urls')),
     (r'^', include('basic.blog.urls')),
 )