[solved]-Try 18 2 Short Entries Thestr Method Entry Model Currently Appends Ellipsis Every Instance Q39051530

just need help with 18.2. i still dont get what ellipises areTRY IT YOURSELF 18-2. Short Entries: The_str__() method in the Entry model currently appends an ellipsis to every instance of Entry when Django shows it in the admin site or the shell. Add an if statement to the_str__() method that adds an ellipsis only if the entry is more than 50 characters long. Use the admin site to add an entry that’s fewer than 50 characters in length, and check that it doesn’t have an ellipsis when viewed. 18-3. The Django API: When you write code to access the data in your project, you’re writing a query. Skim through the documentation for querying your data at https://docs.djangoproject.com/en/1.8/topics/db/queries/. Much of what you see will look new to you, but it will be quite useful as you start to work on your own projects. 18-4. Pizzeria: Start a new project called pizzeria with an app called pizzas. Define a model Pizza with a field called name, which will hold name values such as Hawaiian and Meat Lovers. Define a model called Topping with fields called pizza and name. The pizza field should be a foreign key to Pizza, and name should be able to hold values such as pineapple, Canadian bacon, and sausage. Register both models with the admin site, and use the site to enter some pizza names and toppings. Use the shell to explore the data you entered. Show transcribed image text TRY IT YOURSELF 18-2. Short Entries: The_str__() method in the Entry model currently appends an ellipsis to every instance of Entry when Django shows it in the admin site or the shell. Add an if statement to the_str__() method that adds an ellipsis only if the entry is more than 50 characters long. Use the admin site to add an entry that’s fewer than 50 characters in length, and check that it doesn’t have an ellipsis when viewed. 18-3. The Django API: When you write code to access the data in your project, you’re writing a query. Skim through the documentation for querying your data at https://docs.djangoproject.com/en/1.8/topics/db/queries/. Much of what you see will look new to you, but it will be quite useful as you start to work on your own projects. 18-4. Pizzeria: Start a new project called pizzeria with an app called pizzas. Define a model Pizza with a field called name, which will hold name values such as Hawaiian and Meat Lovers. Define a model called Topping with fields called pizza and name. The pizza field should be a foreign key to Pizza, and name should be able to hold values such as pineapple, Canadian bacon, and sausage. Register both models with the admin site, and use the site to enter some pizza names and toppings. Use the shell to explore the data you entered.
Expert Answer
Answer to TRY IT YOURSELF 18-2. Short Entries: The_str__() method in the Entry model currently appends an ellipsis to every instan… . . .
OR

