如何在Django视图中将success_url
乘以?我试过了,但是没用:
class ResetPasswordRequestView(FormView):
template_name = "registration/password_reset_form.html"
form_class = PasswordResetRequestForm
def post(self, request, *args, **kwargs):
form = self.form_class(request.POST)
if form.is_valid():
data = form.cleaned_data["email_or_username"]
if self.validate_email_address(data) is True:
success_url = '/reset/password/email/'
else:
success_url = '/reset/password/username/'
答案 0 :(得分:0)
您可以覆盖form_valid
method [Django-doc],然后返回 List<Person> newList = arrayList.stream()
.sorted(Comparator.reverseOrder(Person::getAge)) //Error
.limit(3)
.collect(Collectors.toList());
newList.forEach(System.out::println);
:
HttpResponseRedirect