BE
Size: a a a
BE
BE
PZ
@property
def errors(self):
"""Return an ErrorDict for the data provided for the form."""
if self._errors is None:
self.full_clean()
return self._errors
BE
@property
def errors(self):
"""Return an ErrorDict for the data provided for the form."""
if self._errors is None:
self.full_clean()
return self._errors
tn
BE
tn
PZ
print(user_form.errors)
profile = Profile.objects.filter(slug=slug).first()то есть тебе надо найти профиль по слагу из урла, и это профиль передать в форму. Тогда валидация слага будет правильна.
form = ProfileForm(request.POST, instance=profile)
if form.is_valid():
...
BE
tn
PZ
@property
def errors(self):
"""Return an ErrorDict for the data provided for the form."""
if self._errors is None:
self.full_clean()
return self._errors
def is_valid(self):
"""Return True if the form has no errors, or False otherwise."""
return self.is_bound and not self.errors
BE
@property
def errors(self):
"""Return an ErrorDict for the data provided for the form."""
if self._errors is None:
self.full_clean()
return self._errors
def is_valid(self):
"""Return True if the form has no errors, or False otherwise."""
return self.is_bound and not self.errors
BE
PZ
BE
BE
PZ
BE
PZ
PZ