### Finding divisor and certain ideals

Hey SAGE-Community,

I am new to SAGE and looking for some help for a small university project.
Given 𝒪_{K} as the ring of integers to K=ℚ(√5). Given also a totally negative number *d* ∈ 𝒪_{K}^{2}. How can I calculate the largest integral ideal **f** in K whose square divides *d* such that *d* is a square modulo 4 **f**?

~~Thanks ~~A second question is: For any given Ideal **i**, how can I find all the divisor ideals?

I guess that both questions are rather easily done in SAGE but I am missing the necessary experience. Anyways, thanks a lot in advance!