Skip to main content

ModelAdmin mixins to extend admin field sets

Project description

pypi travis 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:

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:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

edc_fieldsets-0.1.6-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file edc_fieldsets-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: edc_fieldsets-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for edc_fieldsets-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6ce098c0e91f24b9ec732767863af12d0a68ac2b22d68ac64f53ac2b5edb8118
MD5 f3b04f7e55ef6c0bedceffada6d2f434
BLAKE2b-256 c61320d094282bb7eecd98bbcb7ceca6344fe660825d4ef464f72ccfb50f6e55

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page