[Answered ]-Getting string from CharField

2👍

You should in your views.py:

form = EntryForm(request.POST, instance=instance)
if form.is_valid():
    url = form.cleaned_data['url']

0👍

Use Form.clean() function to get form data.

def get_url(self):
    cleaned_data = self.clean()
    return cleaned_data.get('url')

Why not use is_valid()?

is_valid() calls clean() on the form automatically. You use
is_valid() in your views, and clean() in your form classes.

This function is Form function, not View function.

Leave a comment