This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A1(object): | |
def __init__(self, **kwargs): | |
for k,v in kwargs.items(): | |
setattr(self, k, v) | |
class A2(object): | |
def __init__(self, **kwargs): | |
self.__dict__.update(kwargs) | |
class B1(A1): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Proxy(Page): | |
""" | |
A general content type for creating links to existing pages | |
in the page menu. Act as a placeholder for the first child | |
page if no page is explicitely being proxied. | |
""" | |
target = models.ForeignKey("Page", related_name="proxies", blank=True, null=True) | |
class Meta: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is the gunicorn config file for the websocket server. | |
worker_class = "geventwebsocket.gunicorn.workers.GeventWebSocketWorker" | |
bind = "0.0.0.0:9000" | |
workers = 1 | |
timeout = 10000000000 | |
loglevel = "error" | |
proc_name = "websocket-server" | |
# Modify paths here as required - allows websocket server to run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/mezzanine/generic/fields.py b/mezzanine/generic/fields.py | |
index 277b04d..cd3160c 100644 | |
--- a/mezzanine/generic/fields.py | |
+++ b/mezzanine/generic/fields.py | |
@@ -36,9 +36,6 @@ class BaseGenericRelation(GenericRelation): | |
attribute for the ``to`` argument. | |
""" | |
kwargs.setdefault("object_id_field", "object_pk") | |
- to = getattr(self, "related_model", None) | |
- if to: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/modeltranslation/translator.py b/modeltranslation/translator.py | |
index 18bc743..c6edfb6 100644 | |
--- a/modeltranslation/translator.py | |
+++ b/modeltranslation/translator.py | |
@@ -150,7 +150,12 @@ def add_translation_fields(model, opts): | |
# Rebuild information about parents fields. If there are opts.local_fields, field cache would be | |
# invalidated (by model._meta.add_field() function). Otherwise, we need to do it manually. | |
if len(opts.local_fields) == 0: | |
- model._meta._fill_fields_cache() | |
+ try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/mezzanine/utils/conf.py b/mezzanine/utils/conf.py | |
index 1f9c321..5d8bef2 100644 | |
--- a/mezzanine/utils/conf.py | |
+++ b/mezzanine/utils/conf.py | |
@@ -110,9 +110,15 @@ def set_dynamic_settings(s): | |
warn("USE_MODETRANSLATION setting is set to True but django-" | |
"modeltranslation is not installed. Disabling it.") | |
else: | |
- # Force i18n so we are assured that modeltranslation is active | |
- s["USE_I18N"] = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from copy import deepcopy | |
from django.contrib import admin | |
from django.utils.translation import activate, get_language | |
from modeltranslation.admin import TranslationAdmin, TranslationTabularInline | |
from mezzanine.conf import settings | |
from mezzanine.core.admin import TabularDynamicInlineAdmin | |
applications = settings.INSTALLED_APPS | |
def save_obj_for_every_language(obj): | |
""" |