Re: Problem with get_absolute_url() in admin

2018-06-11 Thread Joakim Hove
Thank you; my main problem was with the sites model - and the default value for SITE_ID == 1. I had no intention of hardcoding the URL. On Mon, Jun 11, 2018 at 12:58 AM Anthony Anonde wrote: > the example.com is am example django give for Site. Which means there is > a way for you to manage mor

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Anthony Anonde
the example.com is am example django give for Site. Which means there is a way for you to manage more than one site at a time, basically using the site_id. To you Questions, i don't understand why you want to hard code your uri routing like that when you can easily use the app_name and name conv

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Joakim Hove
Thank you; that was indeed it! On Sunday, June 10, 2018 at 11:03:54 PM UTC+2, Melvyn Sopacua wrote: > > On zondag 10 juni 2018 22:54:10 CEST Joakim Hove wrote: > > > > It is the default hostname for django.contrib.sites > > > > > > < > https://github.com/django/django/blob/master/django/contri

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Melvyn Sopacua
On zondag 10 juni 2018 22:54:10 CEST Joakim Hove wrote: > > > It is the default hostname for django.contrib.sites > > > > > ent.py#L28> with SITE_ID = 1. > > OK - so that might be a smoking gun that I have not configured

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Joakim Hove
> > > > > It is the default hostname for django.contrib.sites > > > with SITE_ID = 1. > > OK - so that might be a smoking gun that I have not configured the "sites" model correctly? I have so far not reall

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Melvyn Sopacua
On zondag 10 juni 2018 13:30:51 CEST Joakim Hove wrote: > things do not work from the Admin. When I click on the "View on Site" link > i am redirected to "http://example.com/transaction/view/23635/"; and I get > an error message about failed XML parsing. I have no clue where the > "example.com" ad

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Joakim Hove
Thank you for answering; but I do not agree fully with your answer: 1. It is the @permalink decorator which is removed from Django 2.x - not the get_abolute_url() method. 2. I agree using the reverse in the get_absolute_url() is nicer, and I have also tried that - but the ersults were the same .

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Gerald Brown
In version 2 of Django that function has been removed. For v 1.10 here is a link that might help: https://docs.djangoproject.com/en/1.10/ref/models/instances/#get-absolute-url Here is another link that might be of help: https://stackoverflow.com/questions/13503645/what-is-permalink-and-get-abs

Problem with get_absolute_url() in admin

2018-06-10 Thread Joakim Hove
Hello, I have a model `Transaction` which can be viewed at the url: /transaction/view/$ID/ - if I just enter that url in the browser, or in template everything works. But when I have the following get_abolute_url() method: def get_absolute_url(self): return "/transaction/view/{}/".format(