David Paccoud avatar David Paccoud committed 272fb8e

Integrated translations in admin interface

Comments (0)

Files changed (6)

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',
 )
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.