Skip to main content

ModelAdmin mixins to extend admin field sets

Project description

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:

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 Distribution

edc_fieldsets-1.0.1.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

edc_fieldsets-1.0.1-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

Details for the file edc_fieldsets-1.0.1.tar.gz.

File metadata

  • Download URL: edc_fieldsets-1.0.1.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for edc_fieldsets-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e5b678de2a3be7bd1bec7a42bc95eabcc984a7ddb2d20c30f75e85d6f17523c1
MD5 7afa4d36e518d2614ac849174979bd22
BLAKE2b-256 bc56c89e9b2a6d6617ba81d92bd766092765fd37ee90ddab521cc7435e8487ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edc_fieldsets-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 31.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for edc_fieldsets-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 272effb4809a2ec409eeb35e6c259fe8c88aca739f0da0afafa88012e5bb135a
MD5 e47c26cc70214e83c90e23f8765a4fc7
BLAKE2b-256 7215012f4b6a86d72696d2a7bcc63479c1518e68d179864e39a762709cef6dfb

See more details on using hashes here.

Supported by

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