[Python-modules-commits] [django-markupfield] 01/01: New upstream version 1.4.3

Michael Fladischer fladi at moszumanska.debian.org
Tue Oct 31 07:20:18 UTC 2017


This is an automated email from the git hooks/post-receive script.

fladi pushed a commit to branch upstream
in repository django-markupfield.

commit 6ea4efdab77ffd03a695b998a1d7afa8bece2bcd
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date:   Tue Oct 31 08:02:42 2017 +0100

    New upstream version 1.4.3
---
 PKG-INFO                                |  8 +++++---
 README.rst                              |  5 +++--
 django_markupfield.egg-info/PKG-INFO    |  8 +++++---
 django_markupfield.egg-info/SOURCES.txt |  1 -
 django_markupfield.egg-info/pbr.json    |  1 -
 markupfield/__init__.py                 |  2 +-
 markupfield/fields.py                   | 16 +++++++++++-----
 markupfield/tests/models.py             |  1 +
 markupfield/tests/settings.py           |  1 +
 markupfield/tests/tests.py              | 11 +++++------
 setup.cfg                               |  1 -
 setup.py                                |  3 ++-
 12 files changed, 34 insertions(+), 24 deletions(-)

diff --git a/PKG-INFO b/PKG-INFO
index 5bffd6a..7b0d00d 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: django-markupfield
-Version: 1.4.2
+Version: 1.4.3
 Summary: Custom Django field for easy use of markup in text fields
 Home-page: http://github.com/jamesturk/django-markupfield/
 Author: James Turk
@@ -35,9 +35,10 @@ Description: ==================
         Requirements
         ------------
         
-        Requires Django >= 1.8 and Python 2.7 or 3.4+
+        Requires Django >= 1.11 and Python 2.7 or 3.5+
         
-        (1.3.x is the last release to officially support Django 1.4 or Python 3.3)
+        * 1.3.x is the last release to officially support Django 1.4 or Python 3.3
+        * 1.4.x is the last release to officially support Django 1.8-1.10
         
         Settings
         ========
@@ -214,4 +215,5 @@ Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
 Classifier: Environment :: Web Environment
diff --git a/README.rst b/README.rst
index c4cec11..7e4625d 100644
--- a/README.rst
+++ b/README.rst
@@ -27,9 +27,10 @@ corresponding translations to your project translation.
 Requirements
 ------------
 
-Requires Django >= 1.8 and Python 2.7 or 3.4+
+Requires Django >= 1.11 and Python 2.7 or 3.5+
 
-(1.3.x is the last release to officially support Django 1.4 or Python 3.3)
+* 1.3.x is the last release to officially support Django 1.4 or Python 3.3
+* 1.4.x is the last release to officially support Django 1.8-1.10
 
 Settings
 ========
diff --git a/django_markupfield.egg-info/PKG-INFO b/django_markupfield.egg-info/PKG-INFO
index 5bffd6a..7b0d00d 100644
--- a/django_markupfield.egg-info/PKG-INFO
+++ b/django_markupfield.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: django-markupfield
-Version: 1.4.2
+Version: 1.4.3
 Summary: Custom Django field for easy use of markup in text fields
 Home-page: http://github.com/jamesturk/django-markupfield/
 Author: James Turk
@@ -35,9 +35,10 @@ Description: ==================
         Requirements
         ------------
         
-        Requires Django >= 1.8 and Python 2.7 or 3.4+
+        Requires Django >= 1.11 and Python 2.7 or 3.5+
         
-        (1.3.x is the last release to officially support Django 1.4 or Python 3.3)
+        * 1.3.x is the last release to officially support Django 1.4 or Python 3.3
+        * 1.4.x is the last release to officially support Django 1.8-1.10
         
         Settings
         ========
@@ -214,4 +215,5 @@ Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
 Classifier: Environment :: Web Environment
diff --git a/django_markupfield.egg-info/SOURCES.txt b/django_markupfield.egg-info/SOURCES.txt
index 1bc032f..8a4be94 100644
--- a/django_markupfield.egg-info/SOURCES.txt
+++ b/django_markupfield.egg-info/SOURCES.txt
@@ -7,7 +7,6 @@ setup.py
 django_markupfield.egg-info/PKG-INFO
 django_markupfield.egg-info/SOURCES.txt
 django_markupfield.egg-info/dependency_links.txt
-django_markupfield.egg-info/pbr.json
 django_markupfield.egg-info/top_level.txt
 markupfield/__init__.py
 markupfield/fields.py
diff --git a/django_markupfield.egg-info/pbr.json b/django_markupfield.egg-info/pbr.json
deleted file mode 100644
index 378b5b1..0000000
--- a/django_markupfield.egg-info/pbr.json
+++ /dev/null
@@ -1 +0,0 @@
-{"is_release": false, "git_version": "3c7d7b6"}
\ No newline at end of file
diff --git a/markupfield/__init__.py b/markupfield/__init__.py
index 98d186b..4e7c72a 100644
--- a/markupfield/__init__.py
+++ b/markupfield/__init__.py
@@ -1 +1 @@
-__version__ = '1.4.2'
+__version__ = '1.4.3'
diff --git a/markupfield/fields.py b/markupfield/fields.py
index f190d26..4d7f114 100644
--- a/markupfield/fields.py
+++ b/markupfield/fields.py
@@ -6,9 +6,11 @@ from django.utils.encoding import smart_text
 
 from markupfield import widgets
 from markupfield import markup
+from django.contrib.admin.options import FORMFIELD_FOR_DBFIELD_DEFAULTS
+
 
-_rendered_field_name = lambda name: '_%s_rendered' % name
-_markup_type_field_name = lambda name: '%s_markup_type' % name
+_rendered_field_name = lambda name: '_%s_rendered' % name           # noqa
+_markup_type_field_name = lambda name: '%s_markup_type' % name      # noqa
 
 # for fields that don't set markup_types: detected types or from settings
 _MARKUP_TYPES = getattr(settings, 'MARKUP_FIELD_TYPES',
@@ -163,7 +165,10 @@ class MarkupField(models.TextField):
             return value
 
     def value_to_string(self, obj):
-        value = self._get_val_from_obj(obj)
+        if obj is not None:
+            value = self.value_from_object(obj)
+        else:
+            value = self.get_default()
         if hasattr(value, 'raw'):
             return value.raw
         return value
@@ -179,7 +184,8 @@ class MarkupField(models.TextField):
         else:
             return super(MarkupField, self).to_python(value)
 
+
 # register MarkupField to use the custom widget in the Admin
-from django.contrib.admin.options import FORMFIELD_FOR_DBFIELD_DEFAULTS
 FORMFIELD_FOR_DBFIELD_DEFAULTS[MarkupField] = {
-    'widget': widgets.AdminMarkupTextareaWidget}
+    'widget': widgets.AdminMarkupTextareaWidget
+}
diff --git a/markupfield/tests/models.py b/markupfield/tests/models.py
index eeb17bd..0491674 100644
--- a/markupfield/tests/models.py
+++ b/markupfield/tests/models.py
@@ -43,5 +43,6 @@ class NullTestModel(models.Model):
 class DefaultTestModel(models.Model):
     text = MarkupField(null=True, default="**nice**", default_markup_type="markdown")
 
+
 class NullDefaultTestModel(models.Model):
     text = MarkupField(null=False, blank=True, default="*nice*", default_markup_type="markdown")
diff --git a/markupfield/tests/settings.py b/markupfield/tests/settings.py
index 824eb97..f471334 100644
--- a/markupfield/tests/settings.py
+++ b/markupfield/tests/settings.py
@@ -25,6 +25,7 @@ def render_rest(markup):
     parts = publish_parts(source=markup, writer_name="html4css1")
     return parts["fragment"]
 
+
 MARKUP_FIELD_TYPES = [
     ('markdown', markdown.markdown),
     ('ReST', render_rest),
diff --git a/markupfield/tests/tests.py b/markupfield/tests/tests.py
index b66f18a..a938447 100644
--- a/markupfield/tests/tests.py
+++ b/markupfield/tests/tests.py
@@ -9,7 +9,8 @@ from django.utils.encoding import smart_text
 from markupfield.markup import DEFAULT_MARKUP_TYPES
 from markupfield.fields import MarkupField, Markup
 from markupfield.widgets import MarkupTextarea, AdminMarkupTextareaWidget
-from markupfield.tests.models import Post, Article, Concrete, NullTestModel, DefaultTestModel, NullDefaultTestModel
+from markupfield.tests.models import (Post, Article, Concrete, NullTestModel, DefaultTestModel,
+                                      NullDefaultTestModel)
 
 from django.forms.models import modelform_factory
 ArticleForm = modelform_factory(Article, fields=['normal_field', 'normal_field_markup_type',
@@ -119,7 +120,7 @@ class MarkupFieldTestCase(TestCase):
                         "title": "example xss post",
                         "comment_markup_type": "markdown",
                         "body_markup_type": "markdown"}},
-            #{"pk": 4, "model": "tests.post",
+            # {"pk": 4, "model": "tests.post",
             # "fields": {"body": ('<span style="color: red">plain</span> '
             #                     'post\n\nhttp://example.com'),
             #            "comment": ('<span style="color: red">plain</span> '
@@ -350,7 +351,7 @@ class DefaultTestCase(TestCase):
     def test_default_value_rendered(self):
         m = DefaultTestModel()
         m.save()
-        
+
         self.assertEqual(
             m._meta.get_field('_text_rendered').default,
             m._meta.get_field('text').default
@@ -378,12 +379,10 @@ class NullDefaultTestCase(TestCase):
     def test_default_value_rendered(self):
         m = NullDefaultTestModel()
         m.save()
-        
+
         self.assertEqual(
             m._meta.get_field('_text_rendered').default,
             m._meta.get_field('text').default
         )
 
         self.assertEqual(m._text_rendered, "<p><em>nice</em></p>")
-    
-
diff --git a/setup.cfg b/setup.cfg
index 6f08d0e..adf5ed7 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -4,5 +4,4 @@ universal = 1
 [egg_info]
 tag_build = 
 tag_date = 0
-tag_svn_revision = 0
 
diff --git a/setup.py b/setup.py
index 55a6e64..3571b9d 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ long_description = open('README.rst').read()
 
 setup(
     name='django-markupfield',
-    version="1.4.2",
+    version="1.4.3",
     package_dir={'markupfield': 'markupfield'},
     packages=['markupfield', 'markupfield.tests'],
     package_data={'markupfield': ['locale/*/*/*']},
@@ -27,6 +27,7 @@ setup(
         'Programming Language :: Python :: 3',
         'Programming Language :: Python :: 3.4',
         'Programming Language :: Python :: 3.5',
+        'Programming Language :: Python :: 3.6',
         'Environment :: Web Environment',
     ],
 )

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/django-markupfield.git



More information about the Python-modules-commits mailing list