Merge pull request #117 from jedie/dev

Dev
pull/118/head
Jens Diemer 2022-09-13 20:18:46 +02:00 zatwierdzone przez GitHub
commit 8bd65c44b9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
10 zmienionych plików z 786 dodań i 208 usunięć

Wyświetl plik

@ -154,11 +154,13 @@ Files are separated into: "/src/" and "/development/"
## history
* [**dev**](https://github.com/jedie/PyInventory/compare/v0.15.0...main)
* [**dev**](https://github.com/jedie/PyInventory/compare/0.16.0rc1...main)
* tbc
* [v0.16.0rc1 - 19.08.2022](https://github.com/jedie/PyInventory/compare/v0.15.0...0.16.0rc1)
* Update requirements
* Bugfix missing CK-Editor
* Replace Creole base README with markdown
* Remove Docker stuff from README
* tbc
* [v0.15.0 - 19.08.2022](https://github.com/jedie/PyInventory/compare/v0.14.0...v0.15.0)
* Speedup item change list by prefetch "location"
* Better changelists for super users

Wyświetl plik

@ -1,3 +1,3 @@
export PROJECT_NAME=pyinventory
export PROJECT_PACKAGE_NAME=pyinventory
export PROJECT_VERSION=0.15.0
export PROJECT_VERSION=0.16.0rc1

Wyświetl plik

@ -9,7 +9,7 @@
This file is from: https://pypi.org/project/dev-shell/
Source: https://github.com/jedie/dev-shell/blob/main/devshell.py
:copyleft: 2021 by Jens Diemer
:copyleft: 2021-2022 by Jens Diemer
:license: GNU GPL v3 or above
"""
@ -124,7 +124,7 @@ def main(argv):
if not POETRY_PATH.is_file() or force_update:
# Note: Under Windows pip.exe can't replace this own .exe file, so use the module way:
verbose_check_call(PYTHON_PATH, '-m', 'pip', 'install', '-U', 'pip', 'setuptools')
verbose_check_call(PIP_PATH, 'install', 'poetry')
verbose_check_call(PIP_PATH, 'install', 'poetry!=1.2.0')
# install via poetry, if:
# 1. .venv not exists

924
poetry.lock wygenerowano

Plik diff jest za duży Load Diff

Wyświetl plik

@ -1,6 +1,6 @@
[tool.poetry]
name = "PyInventory"
version = "0.15.0"
version = "0.16.0rc1"
description = "Web based management to catalog things including state and location etc. using Python/Django."
authors = ["JensDiemer <git@jensdiemer.de>"]
homepage = "https://github.com/jedie/PyInventory"
@ -49,7 +49,12 @@ django-import-export = "*" # https://github.com/django-import-export/django-imp
django-dbbackup = "*" # https://github.com/django-dbbackup/django-dbbackup
django-tools = ">=0.49.0" # https://github.com/jedie/django-tools/
django-reversion-compare = "*" # https://github.com/jedie/django-reversion-compare/
django-ckeditor = "*" # https://github.com/django-ckeditor/django-ckeditor
# Skip Version 6.3.1-6.3.x
# Because [1] brokes the form widget!
# [1] https://github.com/django-ckeditor/django-ckeditor/commit/6665cb73a11d37216cd83c4b9e85bf4291fa73e6
django-ckeditor = "<=6.3.0,<=6.4.0" # https://github.com/django-ckeditor/django-ckeditor
bx_py_utils = "*" # https://github.com/boxine/bx_py_utils
bx_django_utils = "*" # https://github.com/boxine/bx_django_utils
django-tagulous = "*" # https://github.com/radiac/django-tagulous

Wyświetl plik

@ -4,4 +4,4 @@
:license: GNU GPL v3 or above, see LICENSE for more details.
"""
__version__ = "0.15.0"
__version__ = "0.16.0rc1"

Wyświetl plik

@ -120,8 +120,9 @@
<label for="id_description">
Description:
</label>
<textarea class="vLargeTextField" cols="40" id="id_description" name="description" rows="10">
</textarea>
<div class="django-ckeditor-widget" data-field-id="id_description" style="display: inline-block;">
<textarea cols="40" data-config='{"skin": "moono-lisa", "toolbar_Basic": [["Source", "-", "Bold", "Italic"]], "toolbar_Full": [["Styles", "Format", "Bold", "Italic", "Underline", "Strike", "SpellChecker", "Undo", "Redo"], ["Link", "Unlink", "Anchor"], ["Image", "Flash", "Table", "HorizontalRule"], ["TextColor", "BGColor"], ["Smiley", "SpecialChar"], ["Source"]], "toolbar": "PyInventoryToolbarConfig", "height": "25em", "width": "100%", "filebrowserWindowWidth": 940, "filebrowserWindowHeight": 725, "removeButtons": "Language,Cut,Copy,Paste,Undo,Redo,Anchor", "removePlugins": ["a11yhelp", "adobeair", "ajax", "autoembed", "autolink", "bbcode", "bidi", "clipboard", "codesnippet", "codesnippetgeshi", "contextmenu", "copyformatting", "devtools", "dialog", "dialogadvtab", "div", "divarea", "docprops", "embed", "embedbase", "embedsemantic", "enterkey", "exportpdf", "find", "flash", "forms", "htmlwriter", "iframe", "iframedialog", "language", "magicline", "mathjax", "newpage", "notification", "notificationaggregator", "pagebreak", "pastefromgdocs", "pastefromword", "pastetext", "pastetools", "placeholder", "preview", "print", "save", "scayt", "selectall", "sharedspace", "smiley", "sourcedialog", "specialchar", "stylescombo", "stylesheetparser", "tab", "templates", "uicolor", "widget", "wsc", "xml"], "toolbar_PyInventoryToolbarConfig": [{"name": "basicstyles", "items": ["Bold", "Italic", "Underline", "Strike", "-", "RemoveFormat"]}, {"name": "paragraph", "items": ["NumberedList", "BulletedList", "-", "Outdent", "Indent", "-", "Blockquote", "-", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"]}, {"name": "links", "items": ["Link", "Unlink", "Anchor"]}, {"name": "insert", "items": ["Image", "Table", "HorizontalRule"]}, "/", {"name": "styles", "items": ["Styles", "Format", "Font", "FontSize"]}, {"name": "colors", "items": ["TextColor", "BGColor"]}, {"name": "tools", "items": ["Maximize", "ShowBlocks", "Source"]}, {"name": "about", "items": ["About"]}], "filebrowserUploadUrl": "/ckeditor/upload/", "filebrowserBrowseUrl": "/ckeditor/browse/", "language": "en"}' data-external-plugin-resources="[]" data-id="id_description" data-processed="0" data-type="ckeditortype" id="id_description" name="description" rows="10"></textarea>
</div>
<div class="help">
</div>
</div>

Wyświetl plik

@ -2,7 +2,7 @@
<html dir="ltr" lang="en">
<head>
<title>
Change Item | PyInventory v0.15.0
Change Item | PyInventory v0.16.0rc1
</title>
<link href="/static/admin/css/base.css" rel="stylesheet" type="text/css"/>
<link href="/static/admin/css/nav_sidebar.css" rel="stylesheet" type="text/css"/>
@ -21,6 +21,8 @@
</script>
<script src="/static/tagulous/tagulous.js">
</script>
<script data-ckeditor-basepath="/static/ckeditor/ckeditor/" id="ckeditor-init-script" src="/static/ckeditor/ckeditor-init.js">
</script>
<script src="/static/admin/js/calendar.js">
</script>
<script src="/static/admin/js/collapse.js">
@ -29,6 +31,8 @@
</script>
<script src="/static/tagulous/adaptor/select2-4.js">
</script>
<script src="/static/ckeditor/ckeditor/ckeditor.js">
</script>
<script src="/static/admin/js/admin/DateTimeShortcuts.js">
</script>
<script src="/static/admin/js/vendor/select2/i18n/en.js">
@ -80,7 +84,7 @@
<div id="branding">
<h1 id="site-name">
<a href="/admin/">
PyInventory v0.15.0
PyInventory v0.16.0rc1
</a>
</h1>
</div>
@ -327,8 +331,9 @@
<label for="id_description">
Description:
</label>
<textarea class="vLargeTextField" cols="40" id="id_description" name="description" rows="10">
</textarea>
<div class="django-ckeditor-widget" data-field-id="id_description" style="display: inline-block;">
<textarea cols="40" data-config='{"skin": "moono-lisa", "toolbar_Basic": [["Source", "-", "Bold", "Italic"]], "toolbar_Full": [["Styles", "Format", "Bold", "Italic", "Underline", "Strike", "SpellChecker", "Undo", "Redo"], ["Link", "Unlink", "Anchor"], ["Image", "Flash", "Table", "HorizontalRule"], ["TextColor", "BGColor"], ["Smiley", "SpecialChar"], ["Source"]], "toolbar": "PyInventoryToolbarConfig", "height": "25em", "width": "100%", "filebrowserWindowWidth": 940, "filebrowserWindowHeight": 725, "removeButtons": "Language,Cut,Copy,Paste,Undo,Redo,Anchor", "removePlugins": ["a11yhelp", "adobeair", "ajax", "autoembed", "autolink", "bbcode", "bidi", "clipboard", "codesnippet", "codesnippetgeshi", "contextmenu", "copyformatting", "devtools", "dialog", "dialogadvtab", "div", "divarea", "docprops", "embed", "embedbase", "embedsemantic", "enterkey", "exportpdf", "find", "flash", "forms", "htmlwriter", "iframe", "iframedialog", "language", "magicline", "mathjax", "newpage", "notification", "notificationaggregator", "pagebreak", "pastefromgdocs", "pastefromword", "pastetext", "pastetools", "placeholder", "preview", "print", "save", "scayt", "selectall", "sharedspace", "smiley", "sourcedialog", "specialchar", "stylescombo", "stylesheetparser", "tab", "templates", "uicolor", "widget", "wsc", "xml"], "toolbar_PyInventoryToolbarConfig": [{"name": "basicstyles", "items": ["Bold", "Italic", "Underline", "Strike", "-", "RemoveFormat"]}, {"name": "paragraph", "items": ["NumberedList", "BulletedList", "-", "Outdent", "Indent", "-", "Blockquote", "-", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"]}, {"name": "links", "items": ["Link", "Unlink", "Anchor"]}, {"name": "insert", "items": ["Image", "Table", "HorizontalRule"]}, "/", {"name": "styles", "items": ["Styles", "Format", "Font", "FontSize"]}, {"name": "colors", "items": ["TextColor", "BGColor"]}, {"name": "tools", "items": ["Maximize", "ShowBlocks", "Source"]}, {"name": "about", "items": ["About"]}], "filebrowserUploadUrl": "/ckeditor/upload/", "filebrowserBrowseUrl": "/ckeditor/browse/", "language": "en"}' data-external-plugin-resources="[]" data-id="id_description" data-processed="0" data-type="ckeditortype" id="id_description" name="description" rows="10"></textarea>
</div>
<div class="help">
</div>
</div>

Wyświetl plik

@ -98,8 +98,9 @@
<label for="id_memo">
Description:
</label>
<textarea class="vLargeTextField" cols="40" id="id_memo" name="memo" rows="10">
</textarea>
<div class="django-ckeditor-widget" data-field-id="id_memo" style="display: inline-block;">
<textarea cols="40" data-config='{"skin": "moono-lisa", "toolbar_Basic": [["Source", "-", "Bold", "Italic"]], "toolbar_Full": [["Styles", "Format", "Bold", "Italic", "Underline", "Strike", "SpellChecker", "Undo", "Redo"], ["Link", "Unlink", "Anchor"], ["Image", "Flash", "Table", "HorizontalRule"], ["TextColor", "BGColor"], ["Smiley", "SpecialChar"], ["Source"]], "toolbar": "PyInventoryToolbarConfig", "height": "25em", "width": "100%", "filebrowserWindowWidth": 940, "filebrowserWindowHeight": 725, "removeButtons": "Language,Cut,Copy,Paste,Undo,Redo,Anchor", "removePlugins": ["a11yhelp", "adobeair", "ajax", "autoembed", "autolink", "bbcode", "bidi", "clipboard", "codesnippet", "codesnippetgeshi", "contextmenu", "copyformatting", "devtools", "dialog", "dialogadvtab", "div", "divarea", "docprops", "embed", "embedbase", "embedsemantic", "enterkey", "exportpdf", "find", "flash", "forms", "htmlwriter", "iframe", "iframedialog", "language", "magicline", "mathjax", "newpage", "notification", "notificationaggregator", "pagebreak", "pastefromgdocs", "pastefromword", "pastetext", "pastetools", "placeholder", "preview", "print", "save", "scayt", "selectall", "sharedspace", "smiley", "sourcedialog", "specialchar", "stylescombo", "stylesheetparser", "tab", "templates", "uicolor", "widget", "wsc", "xml"], "toolbar_PyInventoryToolbarConfig": [{"name": "basicstyles", "items": ["Bold", "Italic", "Underline", "Strike", "-", "RemoveFormat"]}, {"name": "paragraph", "items": ["NumberedList", "BulletedList", "-", "Outdent", "Indent", "-", "Blockquote", "-", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"]}, {"name": "links", "items": ["Link", "Unlink", "Anchor"]}, {"name": "insert", "items": ["Image", "Table", "HorizontalRule"]}, "/", {"name": "styles", "items": ["Styles", "Format", "Font", "FontSize"]}, {"name": "colors", "items": ["TextColor", "BGColor"]}, {"name": "tools", "items": ["Maximize", "ShowBlocks", "Source"]}, {"name": "about", "items": ["About"]}], "filebrowserUploadUrl": "/ckeditor/upload/", "filebrowserBrowseUrl": "/ckeditor/browse/", "language": "en"}' data-external-plugin-resources="[]" data-id="id_memo" data-processed="0" data-type="ckeditortype" id="id_memo" name="memo" rows="10"></textarea>
</div>
<div class="help">
</div>
</div>

Wyświetl plik

@ -0,0 +1,24 @@
from ckeditor.widgets import CKEditorWidget
from ckeditor_uploader.fields import RichTextUploadingField, RichTextUploadingFormField
from django.forms import modelform_factory
from django.test import TestCase
from inventory.models import ItemModel
class ItemModelTestCase(TestCase):
def test_item_description_ckeditor(self):
item = ItemModel()
opts = item._meta
model_description_field = opts.get_field('description')
self.assertIsInstance(model_description_field, RichTextUploadingField)
def test_item_description_form_ckeditor(self):
ItemForm = modelform_factory(ItemModel, fields=('description',))
form = ItemForm()
form_field = form.fields['description']
self.assertIsInstance(form_field, RichTextUploadingFormField)
widget = form_field.widget
# Note: django-ckeditor 6.3.1-6.3.x broke the widget loading:
self.assertIsInstance(widget, CKEditorWidget)