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-0.3.6.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

edc_fieldsets-0.3.6-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file edc-fieldsets-0.3.6.tar.gz.

File metadata

  • Download URL: edc-fieldsets-0.3.6.tar.gz
  • Upload date:
  • Size: 31.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.9

File hashes

Hashes for edc-fieldsets-0.3.6.tar.gz
Algorithm Hash digest
SHA256 8578fd25daeab4f3ca9d11c1a6f99bdc2965a8a32208fee1e282140c8a32210e
MD5 3a92265ed5f285c60f807248ba3abef1
BLAKE2b-256 8e92d62faeca39ac9f910e6db22175dc68d2342bcc23720947ce87b602885314

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for edc_fieldsets-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c85a55899c72a52fd8487eb0119acd35458e59e0cf89ebec33a0c7d551055871
MD5 f9580d318052d799a811ca46531f0551
BLAKE2b-256 afa5c6079e569f2ef21b7b33e5f219874055392bb8d06a22dfabfce7d0cfc5c2

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