Important Info & Conclusion:
Django can be bit confusing, but it becomes lot easier to understand through coding and lot of practice.
In this book, we have successfully converted our Doggy Day Care Center project into a Django Web Application . I have covered the Home Page , Log In Page and the Contact Us page and would like to leave the Create a New profile page for you all to practice. Well, I can give three hints:
model_name ( column1 = “ data ”, column2 = “ data ”, column3 = 123 ……… )
(stated in section 5.3)
(please refer to previous sections)
Step 1: Create a list of choices. This list is a collection of tuples and these tuple is made of key-value pairs .
Example:
STATE= [
('cal', 'California'),
('ny', 'New York'),
('tx', 'Texas'),
]
Step 2: Then we pass the list of choices into our Django form field for drop down menu.
Example:
state = forms.CharField(widget=forms. Select (choices=STATE))
--------------------------------------