Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add some files to test_project

  • Loading branch information...
commit 79785110e5682428dbc71debbd0357e4a466bfa5 1 parent c73e816
@juanpex authored
View
9 model_i18n/__init__.py
@@ -62,8 +62,13 @@ def _load_conf(*args, **kwargs):
import_module(settings.MODEL_I18N_CONF)
-def ensure_models(sender, **kwargs):
+def ensure_models(**kwargs):
+ stack = inspect.stack()
+ for stack_info in stack[1:]:
+ if '_load_conf' in stack_info[3]:
+ return
from model_i18n import loaders
loaders.autodiscover()
-signals.class_prepared.connect(ensure_models)
+ensure_models()
+# signals.class_prepared.connect(ensure_models)
View
33 test_project/initial.json
@@ -0,0 +1,33 @@
+[
+ {
+ "pk": 1,
+ "model": "app.item",
+ "fields": {
+ "content": "Content 1",
+ "translations": [],
+ "slug": "title-1",
+ "title": "Title 1"
+ }
+ },
+ {
+ "pk": 1,
+ "model": "app.itemtranslation",
+ "fields": {
+ "content": "Contenido 1",
+ "_language": "es",
+ "_master": 1,
+ "title": "T\u00edtulo 1"
+ }
+ },
+ {
+ "pk": 2,
+ "model": "app.itemtranslation",
+ "fields": {
+ "content": "Contenu 1",
+ "_language": "fr",
+ "_master": 1,
+ "title": "Titre 1"
+ }
+ }
+]
+
View
11 test_project/templates/flatpages/default.html
@@ -0,0 +1,11 @@
+{% extends "base.html" %}
+
+{% block content %}
+<a href="/">Back</a>
+<br>
+<h1>{{ flatpage.title }}</h1>
+<p>
+<strong>{{ flatpage.content }}</strong>
+</p>
+{% endblock %}
+
Please sign in to comment.
Something went wrong with that request. Please try again.