def lookups(self, request, model_admin): activitys = [] for activity in Activity.objects.filter( department__in=AdminUserInformation.get_departments_admin( request.user)).order_by("department__name", "-start_date"): activitys.append((str(activity.pk), str(activity))) return activitys
def lookups(self, request, model_admin): departments = [("any", "Alle frivillige samlet"), ("none", "Ikke frivillig")] for department in AdminUserInformation.get_departments_admin( request.user).order_by("name"): departments.append((str(department.pk), department.name)) return departments
def lookups(self, request, model_admin): activitys = [("none", "Deltager ikke"), ("any", "Alle deltagere samlet")] for activity in Activity.objects.filter( department__in=AdminUserInformation.get_departments_admin(request.user) ).order_by("department__name", "-start_date"): activitys.append((str(activity.pk), str(activity))) return activitys
def lookups(self, request, _model_admin): return [ (str(a.pk), str(a)) for a in Activity.objects.filter( department__in=AdminUserInformation.get_departments_admin(request.user), activitytype__id__in=["FORLØB", "ARRANGEMENT"], end_date__gte=timezone.now(), ).order_by("department__name", "-start_date") ]
def lookups(self, request, model_admin): departments = [ ("any", "Alle opskrevne samlet"), ("none", "Ikke skrevet på venteliste"), ] for department in AdminUserInformation.get_departments_admin( request.user).order_by("name"): departments.append((str(department.pk), department.name)) return departments
def get_queryset(self, request): qs = super(ActivityInviteInline, self).get_queryset(request) if request.user.is_superuser: return qs return qs.filter( activity__end_date__gt=timezone.now(), activity__department__in=AdminUserInformation.get_departments_admin( request.user ), )
def lookups(self, request, model_admin): return [(str(department.pk), department.name) for department in AdminUserInformation.get_departments_admin( request.user).order_by("name")]