How to use the river.models.proceeding.Proceeding.objects.filter function in river

To help you get started, weโ€™ve selected a few river examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github javrasya / django-river / river / services / proceeding.py View on Github external
current_states = list(current_states.values_list('pk', flat=True)) if current_states else [workflow_object.get_state()]
        next_proceedings = Proceeding.objects.filter(workflow_object=workflow_object, meta__transition__source_state__in=current_states)
        if workflow_object.proceeding:
            next_proceedings = next_proceedings.exclude(pk=workflow_object.proceeding.pk)
        if next_proceedings.exists() and not next_proceedings.filter(pk__in=proceeding_pks).exists() and (
                    not limit or index < limit):
            proceedings = ProceedingService.get_next_proceedings(
                workflow_object,
                proceeding_pks=proceeding_pks + list(next_proceedings.values_list('pk', flat=True)),
                current_states=State.objects.filter(
                    pk__in=next_proceedings.values_list('meta__transition__destination_state', flat=True)),
                index=index,
                limit=limit
            )
        else:
            proceedings = Proceeding.objects.filter(pk__in=proceeding_pks)

        return proceedings
github javrasya / django-river / river / services / proceeding.py View on Github external
def get_final_proceedings(content_type):
        return Proceeding.objects.filter(meta__children__isnull=True, content_type=content_type)