Search code examples
pythondjangodjango-rest-framework

How to get the data from BoundField?


I would like to get the number 2 from my BoundField object, that's problematic because it is not iterable or doesnt support indexing.

<BoundField value=2 errors=None>

Can someone please help?


Solution

  • https://docs.djangoproject.com/en/2.2/_modules/django/forms/boundfield https://docs.djangoproject.com/en/2.2/ref/forms/api/#django.forms.BoundField.value

    You can access a BoundField's value with BoundField.value().