Answer the question
In order to leave comments, you need to log in
How to pass data from a method of one class to a method of another?
Tell me please,
from django.http import HttpResponseRedirect
from django.views.generic import FormView
from django.core.urlresolvers import reverse
class SomeForm(FormView):
form_class = some_form
def form_valid(self, form):
# отсюда осуществить перенаправление
# и отправить form в метод def get класса, что ниже
return HttpResponseRedirect(reverse('urlname')))
class SomeView(object):
def get(self, request, *args, **kwargs):
# тут эту форму получить
# при этом url SomeView должен состоять
# из одного конкретного слова, не более
url(r'/word/$', SomeView.as_view())
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question