Stand With Ukraine

Changelog

📖 - documentation is required issue

0.12.1

  • 📖 SimpleExecNoCall
  • 📖 GiveOneKeyMixin
  • 📖 SimpleExecOneKey
  • 📖 SimpleExecOneKeyNoCall
  • 📖 STATIC_INCLUDES.UNITED_SETTINGS

0.12

  • internal constants refactoring to Enums.
  • validation changes on the list view using content_settings_context
  • Admin: fix delete link

0.11.4

  • from content_settings.conf import settings

0.11.2

  • new attributes on_change and on_change_commited
  • pass user object in the preview

0.11.1 hot fix for edit form

0.11 Preview On Site

DictSuffixesPreviewMixin

  • admin can now preview settings on site before applying
  • new middleware middlewares.preivew_on_site

0.10.2

  • help_text is alternative for help attribute
  • fix warnings
  • using urls is optional

0.10 AdminPreviewActionsMixin

  • SplitByFirstLine is now in EachMixin
  • SplitByFirstLine.split_type can be a dict with key:cs_type
  • AdminPreviewActionsMixin
  • new attribute validators_raw

0.9 Django Admin Panel

  • Fixing a lot of bugs with admin of content settings. Such as preivew, search, tags filters and cetera
  • fixing dynamic work with local changes in content settings
  • fix help text for user defined types
  • if variable constant or removed from code - admin is not allowed to see it in django admin
  • new type DjangoModelTemplateHTML
  • fix issue with \r\n in tags field for user defined types
  • remove attribute empty_is_none, we have EmptyNoneMixin mixin instead
  • validators can be tuple and list now
  • EachMixin now works only with expected types.
  • new class for EachMixin - each.Values - convers all values in the dict
  • fixing bugs with lazy object
  • for CallToPythonMixin, preview_validators and admin_preview_call are removed. Now, all of the validators, that are instance of call_validator will be shows in preview and settings call will be always shown if more than one validators are for preview
  • the change above requires massive refactoring for preview of template/call types
  • if SimpleCallTemplate doesn't have a required arguments and doesn't have validators - the system uses one validator call_validator()
  • DjangoTemplateHTML(HTMLMixin, DjangoTemplate) -> DjangoTemplateHTML(HTMLMixin, DjangoTemplateNoArgs)

0.8.1

  • SplitByFirstLine.split_key_validator_failed
  • fix preview for each.Keys

0.8 EachMixin and HTMLMixin

  • EachMixin
  • HTMLMixin and DjangoTemplateHTML
  • showing type name(s) in admin panel
  • migrate can also show "adjust" in case of changing tags or/and help
  • yet another admin preview function refactoring.
  • fix quoting in text/python preview

0.7.1 help format

  • Default preview for Exec and Eval is Python
  • SimpleBool more possible input options
  • help_format for SplitTranslation
  • test covarage: 95%

0.7 permissions and content tags

  • 📖 content generated tags - tags that can be generated not based on the given tags, but based on the given value.
  • CONTENT_SETTINGS_TAGS - a list of functions that can generate tags for variable based on value
  • view_permission and view_history_permission
  • SimplePassword
  • json_view_value returns string

0.6.4

  • caching.get_raw_value - new function
  • 📖 context_manager.process_set - correct work with str, list and other iterable (those will be converted to set)
  • prevent resetting value if only help of tags were updated. The value will be reset to default only in case of version update

0.6.3 fix caching for huey and celery

0.6.2 SimpleHTML and DjangoModelTemplateMixin

  • new mixin DjangoModelTemplateMixin and new types DjangoModelEval and DjangoModelExec
  • give for SimpleHTML is now marked safe, so no need to use |safe filter in template
  • fix SimpleEval and SimpleExec permissions
  • fix SimpleStringsList.comment_starts_with

0.6.1 SimpleCSV: you can now set default, required and optional argument for the column type

from content_settings.types import required, optional

var = SimpleCSV(
    csv_fields={
        "name": SimpleString(required),
        "balance": SimpleDecimal("0"),
        "price": SimpleDecimal(optional),
    },
)

0.6 I18N & suffix preview in admin

  • types.mixin.AdminPreviewMixin - build menu on top of preview
  • types.mixin.AdminPreviewSuffixesMixin - top menu build based on using suffixes
  • types.mixin.DictSuffixesPreviewMixin - mix with DictSuffixesMixin

DictSuffixesPreviewMixin

  • types.array.SplitByFirstLine - splitting text by multiple suffixes with custom chooser of the default value
  • types.array.SplitTranslation - types.array.SplitByFirstLine with chooser by the current translation

SplitTranslation

Minor:

  • validate_value now splitted on two validate_raw_value for validation text and validate for validation python object
  • 📖 withtag__NAME - new built-in prefix, that returns all of the names that have tag "name"
  • help_format - by default empty text
  • get_admin_preview_as
  • validate_value and other validators does not return value
  • get_admin_preview_(self, value, name, **kwargs) - has now **kwargs can be passed from the preview request

0.5 User Defined Variables & Constants

  • User Defined Variables - variables can now be created not only in code but also in admin
  • 📖 overwrite_user_defined - new attribute that allows overwrite user defined variable
  • 📖 constant - new attribute that makes the code variable unchangable in admin panel and only default value is using
  • 📖 conf.register_prefix - decorator that allows you to registered a new prefix
  • 📖 startswith__NAME - new built-in prefix, that returns all of the names that starts with NAME
  • dir(content_settings) - shows all of the registered variables
  • db now stores tags and help for all variables
  • 📖 CHECKSUM_USER_KEY_PREFIX and USER_DEFINED_TYPES two new settings
  • fix "Preview Loading..." for variables without preview
  • caching.get_type_by_name - new function
  • test covarage: 93%

0.4.4

  • built-in support huey and celery

0.4.3

  • fix field validators
  • None admin preview by default
  • SimpleHTML - same as SimpleText but with HTML preview
  • EmailString - new base type
  • SimpleExec and SimpleExecNoArgs - new types. Works in the same way as SimpleEval, but using exec instead of eval and return values based on call_return attribute
  • all eval and exec types have superuser as default value for update_permission
  • MakeCallMixin has call suffix, just in case

0.4.2 - local dev fixes

  • handeling removed settigs
  • CONTENT_SETTINGS_VALUES_ONLY_FROM_DB - for DEBUG=False only
  • handleling update version during local debug
  • preview and updates for non-existed settings

0.4.1

  • fix admin fields

0.4 - suffix and fetch_groups deprication

  • lazy_give new function for giving a lazy object of the type. LazyObject has moved to own module types.lazy
  • deprication of fetch_groups attribute and views.FetchSettingsView as a replacement
  • uppercase for variable name is mandatory
  • call suffix for GiveCallMixin. you can call no-args types like content_settings.VAN_NAME__call("value")
  • DictSuffixesMixin - use dict for suffixes, where values are lambdas
  • suffix is URLs for getting value from suffix
  • new URL fetch/<str:name>/suffix/<str:suffix>/
  • test covarage: 89%

0.3 - "give" control and admin preview refactoring

  • give and give_python - new base method allows Type to control how the cached value will be given to the code. See the Cookbook for usecases
  • new mixins GiveCallMixin and MakeCallMixin
  • new classes based on GiveCallMixin - DjangoTemplateNoArgs and SimpleEvalNoArgs
  • Admin Preview refactoring:
    • admin_preview_as new base-class attribute. Possible values html/text/python
    • preview_validators new CallToPythonMixin attribute. A list/tuple of all validators for preview
    • admin_preview_call new CallToPythonMixin bool attribute. Should function execution be shown in preview
  • template_static_includes - new attrubite for SimpleCallTemplate.

0.2.3 - advanced context_managers

  • context_manangers
    • parameter init for processors in context_defaults. You can now not only update default values, but also update assigned values
    • new processors: add_tags, remove_tags, str_append, str_prepend, str_format, help_format
  • new django setting: CONTENT_SETTINGS_CONTEXT_PROCESSORS and CONTENT_SETTINGS_CONTEXT_PROCESSORS - you can now set a default context
  • support default tags for types
  • add default tags for templates and markups types
  • add superuser in permissions
  • fix: content_settings_context
  • test coverage: 87%