SELECT af.AppFormID, af.AppFormTitle, ra.CreateGrant, ra.ReadGrant, ra.UpdateGrant, ra.DeleteGrant, ra.PrintGrant FROM public.appforms as af left join public.roleaccesses as ra on af.appformid = ra.appformid and ra.roleid = 2
query= orm.left_join((af.AppFormID, af.AppFormTitle, ra.CreateGrant, ra.ReadGrant, ra.UpdateGrant, ra.DeleteGrant, ra.PrintGrant) for af in AppForms for ra in af.RoleAccess if ra.RoleID.RoleID == id)
But, "if" is known as "WHERE" cause. How can I solve this problem?
SELECT af.AppFormID, af.AppFormTitle, ra.CreateGrant, ra.ReadGrant, ra.UpdateGrant, ra.DeleteGrant, ra.PrintGrant FROM public.appforms as af left join public.roleaccesses as ra on af.appformid = ra.appformid and ra.roleid = 2
query= orm.left_join((af.AppFormID, af.AppFormTitle, ra.CreateGrant, ra.ReadGrant, ra.UpdateGrant, ra.DeleteGrant, ra.PrintGrant) for af in AppForms for ra in af.RoleAccess if ra.RoleID.RoleID == id)
But, "if" is known as "WHERE" cause. How can I solve this problem?