X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/3483b0fcb5ca9c720d914f2a5b822a40ec07390f..9a761497081506a237bcec3319f2608ea7fb4004:/apps/explorer/models.py?ds=sidebyside diff --git a/apps/explorer/models.py b/apps/explorer/models.py index ace513d4..a1cb56cf 100644 --- a/apps/explorer/models.py +++ b/apps/explorer/models.py @@ -1,3 +1,4 @@ +# -*- encoding: utf-8 -*- import os from django.db import models @@ -10,6 +11,29 @@ import toolbar.models from explorer import fields class EditorSettings(models.Model): + """Ustawienia edytora dla użytkownika. + + Pole settings zawiera obiekt JSON o kluczach: + - panels - lista otwartych paneli i ich proporcje + - recentFiles - lista otwartych plików i ustawienia dla nich + + Przykład: + { + 'panels': [ + {'name': 'htmleditor', 'ratio': 0.5}, + {'name': 'gallery', 'ratio': 0.5} + ], + 'recentFiles': [ + { + 'fileId': 'mickiewicz_pan_tadeusz.xml', + 'panels': [ + {'name': 'htmleditor', 'ratio': 0.4}, + {'name': 'gallery', 'ratio': 0.6} + ] + } + ] + } + """ user = models.ForeignKey(User, unique=True) settings = fields.JSONField()