Import django-markupfield_1.4.1.orig.tar.gz
Michael Fladischer
7 years ago
0 | 1.4.1 - 6 October 2016 | |
1 | ====================== | |
2 | - compatibility tweaks for Django 1.9 and 1.10 | |
3 | ||
0 | 4 | 1.4.0 - 17 December 2015 |
1 | 5 | ========================= |
2 | 6 | - bugfixes for Django 1.9 |
0 | 0 | Metadata-Version: 1.1 |
1 | 1 | Name: django-markupfield |
2 | Version: 1.4.0 | |
2 | Version: 1.4.1 | |
3 | 3 | Summary: Custom Django field for easy use of markup in text fields |
4 | 4 | Home-page: http://github.com/jamesturk/django-markupfield/ |
5 | 5 | Author: James Turk |
34 | 34 | Requirements |
35 | 35 | ------------ |
36 | 36 | |
37 | Requires Django >= 1.7 and Python 2.7 or 3.4+ | |
38 | ||
39 | (1.3 is the last release to officially support Django 1.4 or Python 3.3) | |
37 | Requires Django >= 1.8 and Python 2.7 or 3.4+ | |
38 | ||
39 | (1.3.x is the last release to officially support Django 1.4 or Python 3.3) | |
40 | 40 | |
41 | 41 | Settings |
42 | 42 | ======== |
145 | 145 | ('wiki', my_wiki_render_func) |
146 | 146 | ) |
147 | 147 | MarkupField(markup_choices=CUSTOM_RENDERERS) |
148 | ||
149 | .. note:: | |
150 | When using ``markdown``, be sure to use ``markdown.markdown`` and not | |
151 | the ``markdown.Markdown`` class, the class requires an explicit ``reset`` | |
152 | to function properly in some cases. (See [issue #40](https://github.com/jamesturk/django-markupfield/issues/40) | |
153 | for details.) | |
154 | ||
148 | 155 | |
149 | 156 | Accessing a MarkupField on a model |
150 | 157 | ---------------------------------- |
26 | 26 | Requirements |
27 | 27 | ------------ |
28 | 28 | |
29 | Requires Django >= 1.7 and Python 2.7 or 3.4+ | |
29 | Requires Django >= 1.8 and Python 2.7 or 3.4+ | |
30 | 30 | |
31 | (1.3 is the last release to officially support Django 1.4 or Python 3.3) | |
31 | (1.3.x is the last release to officially support Django 1.4 or Python 3.3) | |
32 | 32 | |
33 | 33 | Settings |
34 | 34 | ======== |
138 | 138 | ) |
139 | 139 | MarkupField(markup_choices=CUSTOM_RENDERERS) |
140 | 140 | |
141 | .. note:: | |
142 | When using ``markdown``, be sure to use ``markdown.markdown`` and not | |
143 | the ``markdown.Markdown`` class, the class requires an explicit ``reset`` | |
144 | to function properly in some cases. (See [issue #40](https://github.com/jamesturk/django-markupfield/issues/40) | |
145 | for details.) | |
146 | ||
147 | ||
141 | 148 | Accessing a MarkupField on a model |
142 | 149 | ---------------------------------- |
143 | 150 |
0 | 0 | Metadata-Version: 1.1 |
1 | 1 | Name: django-markupfield |
2 | Version: 1.4.0 | |
2 | Version: 1.4.1 | |
3 | 3 | Summary: Custom Django field for easy use of markup in text fields |
4 | 4 | Home-page: http://github.com/jamesturk/django-markupfield/ |
5 | 5 | Author: James Turk |
34 | 34 | Requirements |
35 | 35 | ------------ |
36 | 36 | |
37 | Requires Django >= 1.7 and Python 2.7 or 3.4+ | |
38 | ||
39 | (1.3 is the last release to officially support Django 1.4 or Python 3.3) | |
37 | Requires Django >= 1.8 and Python 2.7 or 3.4+ | |
38 | ||
39 | (1.3.x is the last release to officially support Django 1.4 or Python 3.3) | |
40 | 40 | |
41 | 41 | Settings |
42 | 42 | ======== |
145 | 145 | ('wiki', my_wiki_render_func) |
146 | 146 | ) |
147 | 147 | MarkupField(markup_choices=CUSTOM_RENDERERS) |
148 | ||
149 | .. note:: | |
150 | When using ``markdown``, be sure to use ``markdown.markdown`` and not | |
151 | the ``markdown.Markdown`` class, the class requires an explicit ``reset`` | |
152 | to function properly in some cases. (See [issue #40](https://github.com/jamesturk/django-markupfield/issues/40) | |
153 | for details.) | |
154 | ||
148 | 155 | |
149 | 156 | Accessing a MarkupField on a model |
150 | 157 | ---------------------------------- |
0 | {"is_release": false, "git_version": "13efc7b"}⏎ | |
0 | {"is_release": true, "git_version": "452d421"}⏎ |
1 | 1 | |
2 | 2 | import json |
3 | 3 | |
4 | import django | |
4 | 5 | from django.test import TestCase |
5 | 6 | from django.core import serializers |
6 | 7 | from django.utils.encoding import smart_text |
233 | 234 | MarkupTextarea)) |
234 | 235 | |
235 | 236 | def test_markuptextarea_render(self): |
237 | if django.VERSION < (1, 10): | |
238 | expected = ('<textarea id="id_normal_field" rows="10" cols="40" ' | |
239 | 'name="normal_field">**normal**</textarea>' | |
240 | ) | |
241 | else: | |
242 | expected = ('<textarea id="id_normal_field" required rows="10" cols="40" ' | |
243 | 'name="normal_field">**normal**</textarea>' | |
244 | ) | |
236 | 245 | a = Article(normal_field='**normal**', |
237 | 246 | normal_field_markup_type='markdown', |
238 | 247 | default_field='**default**', |
240 | 249 | markup_choices_field_markup_type='nomarkup') |
241 | 250 | a.save() |
242 | 251 | af = ArticleForm(instance=a) |
243 | self.assertHTMLEqual( | |
244 | smart_text(af['normal_field']), | |
245 | '<textarea id="id_normal_field" rows="10" cols="40" ' | |
246 | 'name="normal_field">**normal**</textarea>' | |
247 | ) | |
252 | self.assertHTMLEqual(smart_text(af['normal_field']), expected) | |
248 | 253 | |
249 | 254 | def test_no_markup_type_field_if_set(self): |
250 | 255 | """ensure that a field with non-editable markup_type set does not |
280 | 285 | from django.contrib import admin |
281 | 286 | ma = admin.ModelAdmin(Post, admin.site) |
282 | 287 | self.assertTrue(isinstance(ma.formfield_for_dbfield( |
283 | Post._meta.get_field('body')).widget, AdminMarkupTextareaWidget)) | |
288 | Post._meta.get_field('body'), request=None).widget, | |
289 | AdminMarkupTextareaWidget, | |
290 | )) | |
284 | 291 | |
285 | 292 | |
286 | 293 | class MarkupFieldFormSaveTests(TestCase): |