Skip to main content

ModelAdmin mixins to extend admin field sets

Project description

pypi travis coverage


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(
    section='BIOSYNEX® CryptoPS (Semi-quantitative CrAg)')

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

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.

Files for edc-fieldsets, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size edc_fieldsets-0.3.0-py3-none-any.whl (25.2 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page