edc-fieldsets


Nameedc-fieldsets JSON
Version 0.3.22 PyPI version JSON
download
home_pagehttps://github.com/clinicedc/edc-fieldsets
SummaryModelAdmin mixins to extend admin field sets
upload_time2024-11-20 22:49:32
maintainerNone
docs_urlNone
authorErik van Widenfelt
requires_python>=3.12
licenseGPL license, see LICENSE
keywords django edc fieldsets modeladmin clinical trials
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            |pypi| |actions| |coverage|

edc-fieldsets
-------------
ModelAdmin mixins to extend django.admin fieldsets atribute. The class ``Fieldset`` formats a data structure in the format of a django.fieldset.

For example:

.. code-block:: python

    from .fieldsets import fieldset, biosynex_fieldset


    @admin.register(BloodResult, site=ambition_subject_admin)
    class BloodResultsAdmin(CrfModelAdminMixin, admin.ModelAdmin):

        form = BloodResultForm

        conditional_fieldsets = {DAY1: biosynex_fieldset}

        fieldsets_move_to_end = [
            'Conclusion', 'Summary', 'Action', audit_fieldset_tuple[0]]

        fieldsets = fieldset

        radio_fields = ...


where ``fieldset`` is:


.. code-block:: python

    biosynex_fieldset = Fieldset(
        'bios_crag',
        'crag_control_result',
        'crag_t1_result',
        'crag_t2_result',
        section='BIOSYNEX® CryptoPS (Semi-quantitative CrAg)')

    fieldset = [(None, {'fields': ('subject_visit', 'report_datetime',)})]
    fieldset.append(('Conclusion', {
        'fields': ('results_abnormal', 'results_reportable')}))
    fieldset.append(
        ('Summary', {'classes': ('collapse', ), 'fields': ('summary', )}))
    fieldset.append(action_fieldset_tuple)
    fieldset.append(audit_fieldset_tuple)

The ``conditional_fieldsets`` will only display for CRF completed at visit ``DAY1``


.. |pypi| image:: https://img.shields.io/pypi/v/edc-fieldsets.svg
  :target: https://pypi.python.org/pypi/edc-fieldsets

.. |actions| image:: https://github.com/clinicedc/edc-fieldsets/actions/workflows/build.yml/badge.svg
  :target: https://github.com/clinicedc/edc-fieldsets/actions/workflows/build.yml

.. |coverage| image:: https://coveralls.io/repos/github/clinicedc/edc-fieldsets/badge.svg?branch=develop
  :target: https://coveralls.io/github/clinicedc/edc-fieldsets?branch=develop

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/clinicedc/edc-fieldsets",
    "name": "edc-fieldsets",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "django Edc fieldsets modeladmin, clinical trials",
    "author": "Erik van Widenfelt",
    "author_email": "ew2789@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/56/dd/bf8d80fa7023fdba76a9caf22fc945a9973b9d647d102162dda9959814a8/edc_fieldsets-0.3.22.tar.gz",
    "platform": null,
    "description": "|pypi| |actions| |coverage|\n\nedc-fieldsets\n-------------\nModelAdmin mixins to extend django.admin fieldsets atribute. The class ``Fieldset`` formats a data structure in the format of a django.fieldset.\n\nFor example:\n\n.. code-block:: python\n\n    from .fieldsets import fieldset, biosynex_fieldset\n\n\n    @admin.register(BloodResult, site=ambition_subject_admin)\n    class BloodResultsAdmin(CrfModelAdminMixin, admin.ModelAdmin):\n\n        form = BloodResultForm\n\n        conditional_fieldsets = {DAY1: biosynex_fieldset}\n\n        fieldsets_move_to_end = [\n            'Conclusion', 'Summary', 'Action', audit_fieldset_tuple[0]]\n\n        fieldsets = fieldset\n\n        radio_fields = ...\n\n\nwhere ``fieldset`` is:\n\n\n.. code-block:: python\n\n    biosynex_fieldset = Fieldset(\n        'bios_crag',\n        'crag_control_result',\n        'crag_t1_result',\n        'crag_t2_result',\n        section='BIOSYNEX\u00ae CryptoPS (Semi-quantitative CrAg)')\n\n    fieldset = [(None, {'fields': ('subject_visit', 'report_datetime',)})]\n    fieldset.append(('Conclusion', {\n        'fields': ('results_abnormal', 'results_reportable')}))\n    fieldset.append(\n        ('Summary', {'classes': ('collapse', ), 'fields': ('summary', )}))\n    fieldset.append(action_fieldset_tuple)\n    fieldset.append(audit_fieldset_tuple)\n\nThe ``conditional_fieldsets`` will only display for CRF completed at visit ``DAY1``\n\n\n.. |pypi| image:: https://img.shields.io/pypi/v/edc-fieldsets.svg\n  :target: https://pypi.python.org/pypi/edc-fieldsets\n\n.. |actions| image:: https://github.com/clinicedc/edc-fieldsets/actions/workflows/build.yml/badge.svg\n  :target: https://github.com/clinicedc/edc-fieldsets/actions/workflows/build.yml\n\n.. |coverage| image:: https://coveralls.io/repos/github/clinicedc/edc-fieldsets/badge.svg?branch=develop\n  :target: https://coveralls.io/github/clinicedc/edc-fieldsets?branch=develop\n",
    "bugtrack_url": null,
    "license": "GPL license, see LICENSE",
    "summary": "ModelAdmin mixins to extend admin field sets",
    "version": "0.3.22",
    "project_urls": {
        "Homepage": "https://github.com/clinicedc/edc-fieldsets"
    },
    "split_keywords": [
        "django edc fieldsets modeladmin",
        " clinical trials"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4c817b241170fc68624d189aba72bb676f04aafb8f76823e7e58d477d1309e75",
                "md5": "c37803516508d698e8f58a7cd49d04a6",
                "sha256": "725d643f49f8eb798480423c0657a6eb91466a78f8117ce6f248d56803774e03"
            },
            "downloads": -1,
            "filename": "edc_fieldsets-0.3.22-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c37803516508d698e8f58a7cd49d04a6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 30388,
            "upload_time": "2024-11-20T22:49:30",
            "upload_time_iso_8601": "2024-11-20T22:49:30.402330Z",
            "url": "https://files.pythonhosted.org/packages/4c/81/7b241170fc68624d189aba72bb676f04aafb8f76823e7e58d477d1309e75/edc_fieldsets-0.3.22-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "56ddbf8d80fa7023fdba76a9caf22fc945a9973b9d647d102162dda9959814a8",
                "md5": "8dc9af5d07d7f7c3533627dc9f00adea",
                "sha256": "ec96bd3b606aee46da97c3f333c81f0077afa0fa10a25839e569fab987978398"
            },
            "downloads": -1,
            "filename": "edc_fieldsets-0.3.22.tar.gz",
            "has_sig": false,
            "md5_digest": "8dc9af5d07d7f7c3533627dc9f00adea",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 31715,
            "upload_time": "2024-11-20T22:49:32",
            "upload_time_iso_8601": "2024-11-20T22:49:32.414292Z",
            "url": "https://files.pythonhosted.org/packages/56/dd/bf8d80fa7023fdba76a9caf22fc945a9973b9d647d102162dda9959814a8/edc_fieldsets-0.3.22.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-20 22:49:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "clinicedc",
    "github_project": "edc-fieldsets",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "edc-fieldsets"
}
        
Elapsed time: 0.92247s