0
0
Djangoframework~10 mins

Fieldsets for form layout in Django - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a fieldset with the title 'Personal Info'.

Django
fieldsets = [("[1]", {'fields': ['first_name', 'last_name']})]
Drag options to blanks, or click blank then click option'
APersonal Info
BUser Data
CContact Details
DAccount Info
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong or unrelated title string.
2fill in blank
medium

Complete the code to include the 'email' field inside the fieldset fields list.

Django
fieldsets = [("Contact Info", {'fields': ['phone', '[1]']})]
Drag options to blanks, or click blank then click option'
Ausername
Baddress
Cemail
Dpassword
Attempts:
3 left
💡 Hint
Common Mistakes
Adding unrelated fields like 'username' or 'password'.
3fill in blank
hard

Fix the error in the fieldsets definition by completing the missing keyword.

Django
fieldsets = [("Login Info", {'[1]': ['username', 'password']})]
Drag options to blanks, or click blank then click option'
Awidgets
Bfields
Clabels
Dhelp_texts
Attempts:
3 left
💡 Hint
Common Mistakes
Using keys like 'labels' or 'widgets' which are not valid here.
4fill in blank
hard

Fill both blanks to create two fieldsets: one titled 'Basic Info' with 'first_name' and 'last_name', and another titled 'Contact' with 'email'.

Django
fieldsets = [('[1]', {'fields': ['first_name', 'last_name']}), ('[2]', {'fields': ['email']})]
Drag options to blanks, or click blank then click option'
ABasic Info
BPersonal Details
CContact
DUser Info
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up titles or using unrelated names.
5fill in blank
hard

Fill all three blanks to define a fieldset with title 'Account', fields 'username' and 'password', and add the CSS class 'wide' to the fieldset.

Django
fieldsets = [('[1]', {'fields': ['[2]', '[3]'], 'classes': ['wide']})]
Drag options to blanks, or click blank then click option'
AAccount
Busername
Cpassword
Demail
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong field names or missing the title.