Skip to content

Commit

Permalink
Clean settings , names
Browse files Browse the repository at this point in the history
Remove un used code
Add settings documentation
  • Loading branch information
RamezIssac committed May 28, 2023
1 parent c7ba73c commit 9da4a21
Show file tree
Hide file tree
Showing 19 changed files with 345 additions and 999 deletions.
170 changes: 0 additions & 170 deletions docs/source/settings.py

This file was deleted.

175 changes: 61 additions & 114 deletions docs/source/topics/settings.rst
Original file line number Diff line number Diff line change
@@ -1,72 +1,56 @@
.. _settings:

========
Settings
========

Jazzmin settings
================

``JAZZMIN_SETTINGS``
ERP framework settings
======================

.. code-block:: python
JAZZMIN_SETTINGS = {
'navigation_expanded': False,
"changeform_format": "single",
}
JAZZMIN_UI_TWEAKS = {
"navbar": "navbar-primary navbar-dark",
"no_navbar_border": True,
"body_small_text": False,
"navbar_small_text": False,
"sidebar_nav_small_text": False,
"accent": "accent-primary",
"sidebar": "sidebar-dark-primary",
"brand_colour": "navbar-primary",
"brand_small_text": False,
"sidebar_disable_expand": False,
"sidebar_nav_child_indent": True,
"sidebar_nav_compact_style": False,
"sidebar_nav_legacy_style": False,
"sidebar_nav_flat_style": False,
"footer_small_text": False
}
Base Models Settings
====================

See :ref:`base_classes` for information on what are Django ERP framework Base Models and how they interact with the rest of the framework
ERP_FRAMEWORK_SETTINGS = {
"site_name": "ERP Framework System",
"site_header": "ERP Framework System",
"index_title": "Dashboard Home",
"index_template": "admin/index.html",
"login_template": "admin/login.html",
"logout_template": "admin/logout.html",
"app_index_template": "admin/app_index.html",
# a function to control be dbfield on all instances, Saves you time to subclass if
# only you need to add a help text or something
"admin_default_formfield_for_dbfield": (
"erp_framework.base.helpers.default_formfield_for_dbfield"
),
"admin_site_class": "erp_framework.admin.admin.ERPFrameworkAdminSite",
"admin_site_namespace": "erp_framework",
"enable_delete_all": False,
}
Flow Control Settings
======================

``RA_ADMIN_SITE_CLASS``
``admin_site_class``
-----------------------

Defaults ``'erp_framework.admin.admin.RaAdminSite'``
Defaults ``'erp_framework.admin.admin.ERPFrameworkAdminSite'``

A dotted path to the main Django ERP framework Admin Site class.
Make sure to inherit from ``RaAdminSiteBase`` in your custom admin site.
Make sure to inherit from ``ERPFrameworkAdminSiteBase`` in your custom admin site.


``RA_ENABLE_ADMIN_DELETE_ALL``
------------------------------
``enable_delete_all``
----------------------

Default ``False``

Control the availability of the admin action "Delete All" on all RaModelAdmin.
While users
Control the availability of the admin action "Delete All" on all ERP framework model admin classes.

``ERP_ADMIN_DEFAULT_FORMFIELD_FOR_DBFIELD_FUNC``
---------------------------------
``admin_default_formfield_for_dbfield``
---------------------------------------

Defaults ``'erp_framework.base.helpers.default_formfield_for_dbfield'``
Default to ``'erp_framework.base.helpers.default_formfield_for_dbfield'``

A dotted path a universal hook that gets called on all 'formfield_for_db_field` on the framework.
You can use this hook to universally control the widgets being displayed without needing to manually set it on each RaModelAdmin
Expand All @@ -76,83 +60,46 @@ The function should have this signature.
.. code-block:: python
def default_formfield_for_dbfield(model_admin, db_field, form_field, request, **kwargs):
...
``RA_DEFAULT_FROM_DATETIME``
----------------------------

Defaults to start of this year (ie first of January). Type `datetime`


``RA_DEFAULT_TO_DATETIME``
--------------------------

Defaults to start of the next year (ie First of January, current year + 1). Type `datetime`
# do something
return form_field
Customization
=============
``RA_THEME``
------------

Defaults to ``'adminlte'``

If you want to create a new Django ERP framework theme, You can override the templates in another path and set it here .

``ERP_ADMIN_INDEX_TEMPLATE``
---------------------------

Defaults to ``'f'{RA_THEME}/index.html'``


``RA_ADMIN_APP_INDEX_TEMPLATE``
-------------------------------

Defaults to ``'f'{RA_THEME}//app_index.html'``

``RA_ADMIN_LOGIN_TEMPLATE``
---------------------------

Defaults to ``f'{RA_THEME}/login.html'``

``RA_ADMIN_LOGGED_OUT_TEMPLATE``
---------------------------------

Defaults to ``f'{RA_THEME}/logged_out.html'``


``ERP_ADMIN_SITE_TITLE``
-----------------------

Defaults to ``_('Django ERP framework Framework')``

``ERP_ADMIN_SITE_HEADER``
------------------------

Defaults to ``_('Django ERP framework Administration')``
Jazzmin settings
================

``ERP_ADMIN_INDEX_TITLE``
------------------------
Jazzmin is a modern responsive skin for the Django admin interface based on the excellent AdminLTE project.
Here is a glimpse f its settings.

Defaults to ``_('Statistics and Dashboard')``
To know more head over to the `Jazzmin Configuration documentation <https://django-jazzmin.readthedocs.io/configuration/>`_


Cache
=====
``JAZZMIN_SETTINGS``
.. code-block:: python
``RA_CACHE_REPORTS``
--------------------
Defaults to ``True``
JAZZMIN_SETTINGS = {
'navigation_expanded': False,
"changeform_format": "single",
}
Enabling Caching for the Reports
JAZZMIN_UI_TWEAKS = {
"navbar": "navbar-primary navbar-dark",
"no_navbar_border": True,
"body_small_text": False,
"navbar_small_text": False,
"sidebar_nav_small_text": False,
"accent": "accent-primary",
"sidebar": "sidebar-dark-primary",
"brand_colour": "navbar-primary",
"brand_small_text": False,
"sidebar_disable_expand": False,
"sidebar_nav_child_indent": True,
"sidebar_nav_compact_style": False,
"sidebar_nav_legacy_style": False,
"sidebar_nav_flat_style": False,
"footer_small_text": False
}
``RA_CACHE_REPORTS_PER_USER``
-----------------------------
Defaults to ``True``
Enable Caching the report value not only per its parameters, but also per each user.
Loading

0 comments on commit 9da4a21

Please sign in to comment.