def __init__(self, *args, **kwargs):
     if 'parent' not in self.base_fields and mptt.VERSION[:2] == (0, 6):
         # Skip bug in django-mptt 0.6.0
         # https://github.com/django-mptt/django-mptt/issues/275
         TranslatableModelForm.__init__(self, *args, **kwargs)
     else:
         super(UrlNodeAdminForm, self).__init__(*args, **kwargs)
    def __init__(self, *args, **kwargs):
        if 'parent' not in self.base_fields and mptt.VERSION[:2] == (0, 6):
            # Skip bug in django-mptt 0.6.0
            # https://github.com/django-mptt/django-mptt/issues/275
            TranslatableModelForm.__init__(self, *args, **kwargs)
        else:
            super(UrlNodeAdminForm, self).__init__(*args, **kwargs)

        if 'override_url' in self.fields:
            self.fields['override_url'].language_code = self.language_code

        # When the is_sitemap field is exposed, make sure it has the right default.
        # This can't be set on the model level, because the default depends on the page type.
        if 'in_sitemaps' in self.fields and not self.instance.pk:
            self.fields['in_sitemaps'].initial = self.instance.plugin.default_in_sitemaps
Esempio n. 3
0
    def __init__(self, *args, **kwargs):
        if 'parent' not in self.base_fields and mptt.VERSION[:2] == (0, 6):
            # Skip bug in django-mptt 0.6.0
            # https://github.com/django-mptt/django-mptt/issues/275
            TranslatableModelForm.__init__(self, *args, **kwargs)
        else:
            super(UrlNodeAdminForm, self).__init__(*args, **kwargs)

        if 'override_url' in self.fields:
            self.fields['override_url'].language_code = self.language_code

        # When the is_sitemap field is exposed, make sure it has the right default.
        # This can't be set on the model level, because the default depends on the page type.
        if 'in_sitemaps' in self.fields and not self.instance.pk:
            self.fields['in_sitemaps'].initial = self.instance.plugin.default_in_sitemaps
    def __init__(self, *args, **kwargs):
        if 'parent' not in self.base_fields and mptt.VERSION[:2] == (0, 6):
            # Skip bug in django-mptt 0.6.0
            # https://github.com/django-mptt/django-mptt/issues/275
            TranslatableModelForm.__init__(self, *args, **kwargs)
        else:
            super(UrlNodeAdminForm, self).__init__(*args, **kwargs)

        if 'override_url' in self.fields:
            self.fields['override_url'].language_code = self.language_code

        # Warn about django-parler issue that inherited models are not yet translatable.
        if is_multilingual_project():
            for f_name in ('meta_description', 'meta_keywords', 'meta_title', 'new_url'):
                if f_name in self.fields:
                    field = self.fields[f_name]
                    field.help_text += " " + ugettext("Note: this field is not yet translatable")
    def __init__(self, *args, **kwargs):
        if "parent" not in self.base_fields and mptt.VERSION[:2] == (0, 6):
            # Skip bug in django-mptt 0.6.0
            # https://github.com/django-mptt/django-mptt/issues/275
            TranslatableModelForm.__init__(self, *args, **kwargs)
        else:
            super(UrlNodeAdminForm, self).__init__(*args, **kwargs)

        if "override_url" in self.fields:
            self.fields["override_url"].language_code = self.language_code

        # When the is_sitemap field is exposed, make sure it has the right default.
        # This can't be set on the model level, because the default depends on the page type.
        if "in_sitemaps" in self.fields and not self.instance.pk:
            self.fields["in_sitemaps"].initial = self.instance.plugin.default_in_sitemaps

        # Warn about django-parler issue that inherited models are not yet translatable.
        if is_multilingual_project():
            for f_name in ("meta_description", "meta_keywords", "meta_title", "new_url"):
                if f_name in self.fields:
                    field = self.fields[f_name]
                    field.help_text += " " + ugettext("Note: this field is not yet translatable")
Esempio n. 6
0
    def __init__(self, *args, **kwargs):
        if 'parent' not in self.base_fields and mptt.VERSION[:2] == (0, 6):
            # Skip bug in django-mptt 0.6.0
            # https://github.com/django-mptt/django-mptt/issues/275
            TranslatableModelForm.__init__(self, *args, **kwargs)
        else:
            super(UrlNodeAdminForm, self).__init__(*args, **kwargs)

        if 'override_url' in self.fields:
            self.fields['override_url'].language_code = self.language_code

        # When the is_sitemap field is exposed, make sure it has the right default.
        # This can't be set on the model level, because the default depends on the page type.
        if 'in_sitemaps' in self.fields and not self.instance.pk:
            self.fields['in_sitemaps'].initial = self.instance.plugin.default_in_sitemaps

        # Warn about django-parler issue that inherited models are not yet translatable.
        if is_multilingual_project():
            for f_name in ('meta_description', 'meta_keywords', 'meta_title', 'new_url'):
                if f_name in self.fields:
                    field = self.fields[f_name]
                    field.help_text += " " + ugettext("Note: this field is not yet translatable")