mirror of
https://github.com/Hopiu/django-modeltranslation.git
synced 2026-04-13 01:40:58 +00:00
Only print debug statements to stdout if the runserver or runserver_plus management commands are used. Resolves issue 16.
This commit is contained in:
parent
37e0ec21d5
commit
0d0cb70eb5
2 changed files with 19 additions and 5 deletions
|
|
@ -1,14 +1,24 @@
|
|||
FIXED: Only print debug statements to stdout if the runserver or
|
||||
runserver_plus management commands are used.
|
||||
Resolves issue 16.
|
||||
FIXED: Removed print statements so that modeltranslation is usable with
|
||||
mod_wsgi.
|
||||
Resolves issue 7.
|
||||
FIXED: Broken admin fields and fieldsets.
|
||||
Resolves issue 9.
|
||||
FIXED: Creation of db fields with invalid python language code.
|
||||
Resolves issue 4.
|
||||
FIXED: Tests to run from any project.
|
||||
Resolves issue 6.
|
||||
FIXED: Removed unused dependency to content type which can break syncdb.
|
||||
Resolves issue 1.
|
||||
|
||||
CHANGED: Removed TRANSLATION_REGISTRY setting.
|
||||
|
||||
ADDED: Initial support for south.
|
||||
Resolves issue 11.
|
||||
ADDED: Support for admin inlines.
|
||||
Resolves issue 12.
|
||||
|
||||
|
||||
v0.1
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import sys
|
||||
from django.db import models
|
||||
from django.conf import settings
|
||||
from modeltranslation.translator import translator
|
||||
|
|
@ -12,7 +13,6 @@ from modeltranslation.translator import translator
|
|||
try:
|
||||
import translation
|
||||
except ImportError:
|
||||
import sys
|
||||
sys.stderr.write("modeltranslation: Error can't find the file " \
|
||||
"'translation.py' in your project root.\n")
|
||||
sys.exit(1)
|
||||
|
|
@ -20,7 +20,11 @@ except ImportError:
|
|||
# After importing all translation modules, all translation classes are
|
||||
# registered with the translator.
|
||||
if settings.DEBUG:
|
||||
translated_model_names = ', '.join(
|
||||
t.__name__ for t in translator._registry.keys())
|
||||
print "modeltranslation: Registered %d models for translation (%s)." % (
|
||||
len(translator._registry), translated_model_names)
|
||||
try:
|
||||
if sys.argv[1] in ('runserver', 'runserver_plus'):
|
||||
translated_model_names = ', '.join(
|
||||
t.__name__ for t in translator._registry.keys())
|
||||
print "modeltranslation: Registered %d models for translation " \
|
||||
"(%s)." % (len(translator._registry), translated_model_names)
|
||||
except IndexError:
|
||||
pass
|
||||
|
|
|
|||
Loading…
Reference in a new issue