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.21.tar.gz
(31.6 kB
view details)
Built Distribution
File details
Details for the file edc-fieldsets-0.3.21.tar.gz
.
File metadata
- Download URL: edc-fieldsets-0.3.21.tar.gz
- Upload date:
- Size: 31.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0648dc5ddbea736867e31bfead8b4da8ef7ddcad0a6f566574bbc9075e1e3825 |
|
MD5 | 69ea3c8d1886103a66afe2d60ce59b44 |
|
BLAKE2b-256 | f790f95e43ac697dfb52643cf67313ce9939f42ffa8c0b34b6afc73dd83d3008 |
File details
Details for the file edc_fieldsets-0.3.21-py3-none-any.whl
.
File metadata
- Download URL: edc_fieldsets-0.3.21-py3-none-any.whl
- Upload date:
- Size: 30.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34fcee148a5d7f67265cae8eee0c75901069d6301fa439c2c9522a755a3a3e5d |
|
MD5 | 2610d462764c0ef959a6b6787210c9b6 |
|
BLAKE2b-256 | 557548396f0a1d46025482c9974737c6bfaf409e78efdee0da2f11b1b5f3438e |