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.14.tar.gz
(31.1 kB
view details)
Built Distribution
File details
Details for the file edc-fieldsets-0.3.14.tar.gz
.
File metadata
- Download URL: edc-fieldsets-0.3.14.tar.gz
- Upload date:
- Size: 31.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d31a87c0e772002d7137f9523ebc1a86b84dadb221122bc0dcb0fae340e9191d |
|
MD5 | db963cfbe3625fd58b604e344ce8d77d |
|
BLAKE2b-256 | 8dbda7f11e8c49b9bf1ee2406f32ae2b36516d4b72929d130938731d41f6c4cb |
File details
Details for the file edc_fieldsets-0.3.14-py3-none-any.whl
.
File metadata
- Download URL: edc_fieldsets-0.3.14-py3-none-any.whl
- Upload date:
- Size: 29.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4aec2de2a0b6630aed071249728ca50b28302916ca49b31f1f5b4e5c1bdcb743 |
|
MD5 | 5e6b05636ecaeba4f873e68020eb9294 |
|
BLAKE2b-256 | af0838243f1a77c17629ed908b4d9abc3642e47fe12ebc67a000c9abec6a141f |