Commits

David Paccoud committed 272fb8e

Integrated translations in admin interface

Comments (0)

Files changed (6)

core/__init__.py

Empty file added.
+from django.contrib import admin
+from modeltranslation.admin import TranslationAdmin
+
+from basic.blog.admin import CategoryAdmin, PostAdmin
+from basic.blog.models import Category, Post
+
+
+class CategoryTranslationAdmin(CategoryAdmin, TranslationAdmin):
+    pass
+
+
+class PostTranslationAdmin(PostAdmin, TranslationAdmin):
+    pass
+
+
+admin.site.unregister(Category)
+admin.site.unregister(Post)
+admin.site.register(Category, CategoryTranslationAdmin)
+admin.site.register(Post, PostTranslationAdmin)
+from django.db import models
+
+# Create your models here.
+"""
+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.
     'tagging',
     'south',
     'modeltranslation',
+    'core',
 )