Try to import reverse_lazy form "django.core.urlresolvers" in your views.py
and declare the DeleteView as:-
class MyDeleteView(DeleteView):
model = models.YourModelName
success_url =
reverse_lazy('Your_app_name_for_urls.py':urlpattern_name_your_wanna_redirect_to)
--
You received th
Indeed
On Wednesday, September 26, 2012 2:45:32 PM UTC-3, Kurtis wrote:
>
> Sometimes, though, you may need to pass variables to a success url. In
> that case, I'd use the "get_success_url" method so you can access the
> 'self' attributes.
>
> On Wed, Sep 26, 2012 at 1:32 PM, Germán
> > wrote:
Sometimes, though, you may need to pass variables to a success url. In that
case, I'd use the "get_success_url" method so you can access the 'self'
attributes.
On Wed, Sep 26, 2012 at 1:32 PM, Germán wrote:
> Just for the record.
>
> Since Django 1.4, the best way to set up success_url in class-
Just for the record.
Since Django 1.4, the best way to set up success_url in class-based generic
views with url names is:
> success_url = reverse_lazy('my_url_name')
On Wednesday, September 21, 2011 4:53:56 PM UTC-3, Xavier Ordoquy wrote:
>
> Hi,
>
> You can also use get_success_url for that:
Hi,
You can also use get_success_url for that:
class ContactView(generic.FormView):
form_class = ContactForm
def get_success_url(self):
return reverse('contact-sent')
Regards,
Xavier
Linovia.
Le 21 sept. 2011 à 00:08, Daniel P a écrit :
> Same problem. You'r not alone!
>
> t
Same problem. You'r not alone!
this is also a solution: http://djangosnippets.org/snippets/2445/
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group,
Had the same issue. Here's what I did in my views.py:
---
from django.utils.functional import lazy
...
class MyDeleteView(DeleteView):
...
success_url = lazy(reverse, str)("success_url_name")
---
Again, I don't know if that's the correct way of doing things, but
worked for me. I think I
I just ran into this today and was curious. My setup is this:
class MyGenericView(DeleteView):
success_url = reverse('my-name')
This will produce the from the original author. I got around this by
overriding get_success_url():
class MyGenericView(DeleteView):
def get_succ
Hi users,
I have a CreateView which I'd like to redirect to a custom success_url
defined in my URLconf. As I want to stick to the DRY-principle I just
did the following:
success_url = reverse("my-named-url")
Unfortunately, this breaks my site by raising an
"ImproperlyConfigured: The included
9 matches
Mail list logo