We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi. I needed to display data after applying queryset.values. As a result, instead of data, ??? in all columns. Model:
class StudyUploadLog(models.Model): study_instance_uid = models.CharField(max_length=150, verbose_name='Study Instance UID') patient = models.CharField(max_length=150, verbose_name='Patient') instance_uid = models.CharField(max_length=150, verbose_name='Instance UID') upload_date = models.DateTimeField(verbose_name='Upload time') completed = models.BooleanField(verbose_name='Completed', default=False)
View:
class UploadingStudies(AjaxDatatableView): model = StudyUploadLog title = 'Лог получения исследований' #initial_order = [["upload_date", "desc"], ] length_menu = [[50, 100, -1], [50, 100, 'Все']] search_values_separator = '+' disable_queryset_optimization_only = True column_defs = [ {'name': 'id', 'visible': False, 'searchable': False, }, {'name': 'patient', 'title': 'Пациент', 'searchable': False, 'visible': True}, {'name': 'study_instance_uid', 'title': 'Идентификатор исследования', 'searchable': False, 'visible': True}, # {'name': 'progress', 'title': 'Прогресс', 'searchable': False, 'visible': True}, {'name': 'images_count', 'title': 'Количество файлов', 'searchable': False, 'visible': True}, {'name': 'start_date', 'title': 'Время начала приема', 'searchable': False, 'visible': True}, {'name': 'end_date', 'title': 'Время окончания приема', 'searchable': False, 'visible': True}, {'name': 'completed', 'title': 'Прием окончен', 'searchable': False, 'visible': True, 'boolean': True,}, ] def get_initial_queryset(self, request=None): queryset = super().get_initial_queryset(request=request) queryset = (queryset.values('patient', 'study_instance_uid', 'completed') .annotate(images_count=Count('instance_uid'), id=Max('id'), start_date=Min('upload_date'), end_date=Max('upload_date'))) return queryset
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi.
I needed to display data after applying queryset.values. As a result, instead of data, ??? in all columns.
Model:
class StudyUploadLog(models.Model):
study_instance_uid = models.CharField(max_length=150, verbose_name='Study Instance UID')
patient = models.CharField(max_length=150, verbose_name='Patient')
instance_uid = models.CharField(max_length=150, verbose_name='Instance UID')
upload_date = models.DateTimeField(verbose_name='Upload time')
completed = models.BooleanField(verbose_name='Completed', default=False)
View:
class UploadingStudies(AjaxDatatableView):
model = StudyUploadLog
title = 'Лог получения исследований'
#initial_order = [["upload_date", "desc"], ]
length_menu = [[50, 100, -1], [50, 100, 'Все']]
search_values_separator = '+'
disable_queryset_optimization_only = True
column_defs = [
{'name': 'id', 'visible': False, 'searchable': False, },
{'name': 'patient', 'title': 'Пациент', 'searchable': False, 'visible': True},
{'name': 'study_instance_uid', 'title': 'Идентификатор исследования', 'searchable': False, 'visible': True},
# {'name': 'progress', 'title': 'Прогресс', 'searchable': False, 'visible': True},
{'name': 'images_count', 'title': 'Количество файлов', 'searchable': False, 'visible': True},
{'name': 'start_date', 'title': 'Время начала приема', 'searchable': False, 'visible': True},
{'name': 'end_date', 'title': 'Время окончания приема', 'searchable': False, 'visible': True},
{'name': 'completed', 'title': 'Прием окончен', 'searchable': False, 'visible': True, 'boolean': True,},
]
def get_initial_queryset(self, request=None):
queryset = super().get_initial_queryset(request=request)
queryset = (queryset.values('patient', 'study_instance_uid', 'completed')
.annotate(images_count=Count('instance_uid'),
id=Max('id'),
start_date=Min('upload_date'),
end_date=Max('upload_date')))
return queryset
The text was updated successfully, but these errors were encountered: