Home > Django > Quizzes > Django Queryset
Django Queryset
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 29% Most missed: “Performs an SQL delete query on all rows in the QuerySet. This method is applied…”
Django Queryset
Time left 00:00
25 Questions

1. Can be used to remove all many-to-many relationships for an instance

2. This sets a field to a particular value for all the objects in a QuerySet. You can only set non-relation fields and ForeignKey fields using this method.

3. This method immediately deletes the object and has no return value.

4. Lookup type that takes either True or False and corresponds to SQL queries of IS NULL and IS NOT NULL - respectively.

5. Disjunction operator for Q objects.

6. Returns an integer representing the number of objects in the database matching the QuerySet. This never raises exceptions.

7. Fields are specified by these

8. Exception raised by get(**kwargs) if no items match the query.

9. This represents a collection of objects from your database. It can have zero - one or many filters.

10. To activate your models

11. Lookup type that returns results greater than or equal to a given value.

12. This object encapsulates a collection of keyword arguments - with the keys being field lookup types. These objects can be combined using the & and | operators - as well as negated with the ~ operator.

13. Lookup type that finds a case-sensitive regular expression match.

14. Lookup type that returns results in a given list.

15. Negation operator for Q objects.

16. Performs an SQL delete query on all rows in the QuerySet. This method is applied instantly. You cannot call this method on a QuerySet that has had a slice taken or can otherwise no longer be filtered.

17. Evaluates the QuerySet (by performing the query) and returns an iterator over the results. A QuerySet typically caches its results internally so that repeated evaluations do not result in additional queries; this method will instead read results dire

18. Returns a new QuerySet containing objects that match the given lookup parameters.

19. Returns a new QuerySet that uses SELECT DISTINCT in its SQL query. This eliminates duplicate rows from the query results.

20. Returns a QuerySet that will automatically "follow" foreign-key relationships - selecting that additional related-object data when it executes its query. This is a performance booster which results in (sometimes much) larger queries but means later u

21. If this option is True - the field is allowed to be blank. Default is False.

22. If you are using this attribute on a ForeignKey or ManyToManyField - you must always specify a unique reverse name for the field.

23. This method returns tuples of values when iterated over. Each tuple contains the value from the respective field passed into the call to this method -- so the first item is the first field - etc.

24. These methods are intended to do "table-wide" things.

25. Returns a ValuesQuerySet -- a QuerySet that returns dictionaries when used as an iterable - rather than model-instance objects.

⚡ Recently practiced quizzes in this topic
Live quiz activity