B SEC ASSIGN-2 - Mod 2 &3 QB
B SEC ASSIGN-2 - Mod 2 &3 QB
1. What is a Model?
2. How would you configure a database connection in a Django web application? Explain the steps
involved and any necessary configuration settings.
3. What are the advantages of using an ORM (Object-Relational Mapping) tool like Django's ORM
for database configuration compared to raw SQL queries?
4. In Django, how do you define models to represent database tables? Provide a simple example of
defining a model with fields such as CharField, IntegerField, and ForeignKey.
5. How does Django's queryset API facilitate efficient querying and filtering of data compared to
traditional SQL queries?
6. Why is it important to define a string representation (__str__ method) for Django models? What
are the benefits of providing a meaningful representation for model instances?
7. Provide an example of implementing the __str__ method for a Django model and explain how it
enhances the usability of the Django admin interface.
8. Explain the process of inserting new data into a database table using Django models. Include how
to handle validation and ensure data integrity during insertion.
9. How does Django handle updating existing records in a database table when changes are made to
model instances? Describe the mechanisms involved.
10. How do you select specific objects from a database table based on certain criteria using Django's
queryset API? Provide examples of using filters, annotations, and aggregations.
11. Discuss the methods available in Django for deleting objects from a database table. What
considerations should be taken into account to avoid unintended data loss?
12. What challenges might arise when evolving the database schema (e.g., adding new fields,
modifying existing fields) in a Django project? How can these challenges be mitigated?
13. Describe the steps involved in migrating Django models to reflect changes in the database schema
without losing existing data or affecting application functionality.
Module - 3 (Questions)
1. How do you activate the Django admin interface for your project?
2. What are the benefits of using the Django admin interface?
3. How do you access the Django admin interface?
4. What actions can you perform using the Django admin interface?
5. What are the different ways to customize the Django admin interface?
6. Can you provide examples of customizations you can make to the admin interface?
7. What is form processing in Django?
8. Explain the steps involved in processing a form in Django.
ATRIA INSTITUTE OF TECHNOLOGY
Anandanagar, Bengaluru – 560 024