Search This Blog

Django - Forms Quiz - 2 HackerRank Questions and Answers Fresco Play TCS

Q.1 A Form instance is either bound to a set of data or unbound.

1) True

2) False

Ans: 1) True




Q.2 To declare the initial value of form fields at runtime, use ________.

1) Form.initial

2) Form.index

3) Form.start

4) Form.first

Ans: 1) Form.initial




Q.3 The clean() method on a Field subclass is responsible for running ________.

1) to_python()

2) run_validators()

3) All the options

Ans: 3) All the options





Q.4 What is the output of the following code?>>> from Django import forms >>> f = forms.CharField() >>> f.clean('')

1) None

2) ’’

3) True

4) Validation Error

Ans: 4) Validation Error





Q.5 A ______ is a layer of abstraction to work with multiple forms on the same page.

1) InlineForm

2) Formset

3) All the options

4) ModelForm

Ans: 2) Formset







No comments:

Post a Comment

If you have any doubts, Please let us know.