ephios icon indicating copy to clipboard operation
ephios copied to clipboard

assign workinghours to participants on federated instances

Open jeriox opened this issue 11 months ago • 2 comments

closes #1501

  • [x] pull consequences from FederatedHost and create them locally
  • [ ] migrate consequeces?

jeriox avatar Mar 04 '25 22:03 jeriox

Coverage Status

coverage: 83.991% (+0.02%) from 83.971% when pulling a545fbd433c2848a7fbfe0b7df43882b44715c60 on federated-workinghours into 9b22c56b5bbe913ca14a83c2ccd6a8d831aee3b7 on main.

coveralls avatar Mar 04 '25 22:03 coveralls

Here's what we discussed about queryset filtering:


def blub():
    handlers = [...]
    consequence_classes = AbstractConsequence.__subclasses__()

    qs = AbstractConsequence.objects.filter(slug__in=map(operator.attrgetter("slug"), handlers)).distinct()
    for handler in enabled_consequence_handlers:
        for ConcreteConsequence in consequence_classes:
            qs = ConcreteConsequence.filter_queryset(handler, qs, user)
	# ==> rather ditch annotations and OR Q-Objects
    return qs

def localConsequence_filter_queryset(handler, qs, user):
    return handler.filter_local_queryset(qs, user)  # filter for nonlocal or other handler or matches criteria

def federatedConsequence_filter_queryset(handler, qs, user):
    return qs.filter(
        Q("is not federated") | Q("matches criteria")
    )

felixrindt avatar Jul 31 '25 19:07 felixrindt