get_absolute_url() necessary with ModelForm ?

10 views
Skip to first unread message

Axel Rau

unread,
Jul 4, 2019, 1:45:47 PM7/4/19
to Django users
I’m using a model in 2 apps with different urls.
Subclasing it and overwriting get_absolute_url() did not work,
because it mangled dbtable.
UpdateView does not work with ModelForm w/o get_absolute_url().

Does there any workaround exist?

Thanks, Axel
---
PGP-Key: CDE74120 ☀ computing @ chaos claudius

Daniel Roseman

unread,
Jul 6, 2019, 12:28:50 PM7/6/19
to Django users
On Thursday, 4 July 2019 18:45:47 UTC+1, Axe...@Chaos1.DE wrote:
I’m using a model in 2 apps with different urls.
Subclasing it and overwriting get_absolute_url() did not work,
because it mangled dbtable.
UpdateView does not work with ModelForm w/o get_absolute_url().

Does there any workaround exist?

Thanks, Axel


UpdateView works perfectly fine without `get_absolute_url()`. It does however need a `success_url` attribute, or a `get_success_url()` method, defined on the view itself.
--
DR.

Axel Rau

unread,
Jul 7, 2019, 10:53:20 AM7/7/19
to django...@googlegroups.com
This worked perfectly!

Thanks, Axel
Reply all
Reply to author
Forward
0 new messages