(user_id: int)
return query_results
Gets organisations a user can manage
Gets organisations a user can manage
Gets organisations a user can manage
def get_organisations_managed_by_user(user_id: int):
        """ Gets organisations a user can manage """
        query_results = (
            Organisation.query.join(organisation_managers)
            .filter(
                (organisation_managers.c.organisation_id == Organisation.id)
                & (organisation_managers.c.user_id == user_id)
            )
            .order_by(Organisation.name)
            .all()
        )
        return query_results
def get_organisations_managed_by_user ( user_id : int ) : query_results = ( Organisation . query . join ( organisation_managers ) . filter ( ( organisation_managers . c . organisation_id == Organisation . id ) & ( organisation_managers . c . user_id == user_id ) ) . order_by ( Organisation . name ) . all ( ) ) return query_results