inital case selection widget
This commit is contained in:
+15
-2
@@ -47,7 +47,7 @@ from generic.models import Examination#, Sign
|
||||
# from generic.models import Examination, Site, Condition, Sign
|
||||
|
||||
from django.contrib.admin.widgets import FilteredSelectMultiple
|
||||
from django.forms.widgets import RadioSelect, TextInput, Textarea
|
||||
from django.forms.widgets import RadioSelect, TextInput, Textarea, Select
|
||||
|
||||
from tinymce.widgets import TinyMCE
|
||||
|
||||
@@ -63,6 +63,18 @@ from crispy_forms.helper import FormHelper
|
||||
|
||||
from atlas.helpers import get_cases_available_to_user
|
||||
|
||||
class CaseSelect(Select):
|
||||
template_name = "atlas/case_select_widget.html"
|
||||
|
||||
|
||||
def create_option(self, *args, **kwargs):
|
||||
option = super().create_option(*args, **kwargs)
|
||||
|
||||
print(option)
|
||||
|
||||
return option
|
||||
|
||||
pass
|
||||
|
||||
class ConditionForm(ModelForm):
|
||||
class Meta:
|
||||
@@ -365,7 +377,8 @@ class CaseForm(ModelForm):
|
||||
url="atlas:presentation-autocomplete"
|
||||
),
|
||||
"subspecialty": CheckboxSelectMultiple(),
|
||||
"pathological_process": CheckboxSelectMultiple()
|
||||
"pathological_process": CheckboxSelectMultiple(),
|
||||
"previous_case": CaseSelect(),
|
||||
}
|
||||
|
||||
def save(self, commit=True):
|
||||
|
||||
Reference in New Issue
Block a user