# Using get\_absolute\_url() \[works in a for loop but not in a single href link\]

**URL:** <https://forum.djangoproject.com/t/using-get-absolute-url-works-in-a-for-loop-but-not-in-a-single-href-link/21071>\
**Category:** Templates & Frontend\
**Created:** [May 21, 2023, 8:54pm UTC](https://forum.djangoproject.com/t/using-get-absolute-url-works-in-a-for-loop-but-not-in-a-single-href-link/21071 "2023-05-21T20:54:21Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [May 27, 2023, 12:56am UTC](https://forum.djangoproject.com/t/using-get-absolute-url-works-in-a-for-loop-but-not-in-a-single-href-link/21071/14 "2023-05-27T00:56:41Z")

</div>

> [@StephanieAG](#):
>
> QUESTION 1

Your rephrase here is spot-on. The link that I posted for that name (`self.request`) is a link to the most brief description in the docs as to what’s happening here.

I would change the wording slightly here in the interest of precision. You wrote:

> [@StephanieAG](#):
>
> the `self.request` object includes another object within it named `user`

I would consider it somewhat more accurate that the `self.request` object contains a _reference_ to another object. That other object is an object of type `User` and is given the name `user`. That user object can contain references to yet more objects.

(Is this difference in wording important? Yes, under some circumstances. In many cases you can ignore the difference, but you should always be aware of it.)

> [@KenWhitesell](#):
>
> `self.object.user`.

Oops - typo. That should have been self.request.user. I had objects on the brain.

> [@StephanieAG](#):
>
> would that mean using something that looks like this for that same line?

Yes, that would do it.

> [@StephanieAG](#):
>
> I think including any more than the above probably starts getting a little too far away from the original topic of the thread.

No worries, we’re here to help.

---

_[View the full topic](https://forum.djangoproject.com/t/using-get-absolute-url-works-in-a-for-loop-but-not-in-a-single-href-link/21071)._
