ModelAdmin mixins to extend admin field sets
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for edc-fieldsets-0.1.2.macosx-10.13-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18b03b26cd084f2a8f054b6fc9353e026f4e462ee9781a84756cce298483d148 |
|
MD5 | 71fc6a37b82ad12fb2d3e1685d415253 |
|
BLAKE2b-256 | 6384b054ac212ebff1de341dbf58cdc28ce5965db74a14970035f9912fdb4a01 |
Close
Hashes for edc_fieldsets-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d3b63b26c8dce57e06ed3c28b7f7dedc454cca2dd7be8263b86466b605cdb99 |
|
MD5 | eb31dd5ff6d760239b23928c6ee2e447 |
|
BLAKE2b-256 | 10e90c44906846589ce7a793801bfc0da02484c97bde4843fc5b017bb71d3f1b |