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
edc-fieldsets-0.3.11.tar.gz
(31.0 kB
view details)
Built Distribution
File details
Details for the file edc-fieldsets-0.3.11.tar.gz
.
File metadata
- Download URL: edc-fieldsets-0.3.11.tar.gz
- Upload date:
- Size: 31.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 958e505620108a96d7c0c9109bbb7f16ced55a9de621c9b6c0cc8212cda92818 |
|
MD5 | 93ed6b8dde95bb0500a6d276ea9d5048 |
|
BLAKE2b-256 | b731032f9f260eca31ca5bf8226aba023bcf959d0ce80e1fed2f3828bbe7c107 |
File details
Details for the file edc_fieldsets-0.3.11-py3-none-any.whl
.
File metadata
- Download URL: edc_fieldsets-0.3.11-py3-none-any.whl
- Upload date:
- Size: 29.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 805f9d4d58eb874f90ffa7c5fb4458a602f8569922d632ac956e54fbfdbc4e8d |
|
MD5 | 3e275e6f14a4d764cf6c107d083289e5 |
|
BLAKE2b-256 | 46c2acb0a84fe2b96943ed1ecd4662a811e160e33af289a95f02ec5dd63c13af |