Test your basic knowledge |

Django Queryset

Subject : it-skills
Instructions:
  • Answer 50 questions in 15 minutes.
  • If you are not ready to take this test, you can study here.
  • Match each statement with the correct term.
  • Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.

This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. These methods are intended to do "table-wide" things.






2. Returns an EmptyQuerySet -- a QuerySet that always evaluates to an empty list. This can be used in cases where you know that you should return an empty result set and your caller is expecting a QuerySet object (instead of returning an empty list - fo






3. This query finds all entries between a start date of start_date and an end date of end_date.






4. Lookup type that returns results with a case-insensitive start sequence.






5. Use this method to reverse the order in which a queryset's elements are returned. Calling this method a second time restores the ordering back to the normal direction.






6. Defines a one-to-one relationship. You use it just like any other Field type: by including it as a class attribute of your model.






7. This query deletes all Entry objects with a pub_date year of 2005.






8. Defines a many-to-one relationship. ou use it just like any other Field type: by including it as a class attribute of your model.






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






10. (1) These cannot be Python reserved words - because that would result in a Python syntax error. (2) These cannot contain more than one underscore in a row - due to the way Django's query lookup syntax works.






11. Conjuntion operator for Q objects.






12. Lookup type that returns results with a case-sensitive start sequence.






13. A Manager method that returns a new QuerySet containing objects that match the given lookup parameters.






14. Extra text to be displayed under the field on the object's admin form to provide assistance to users. It's useful for documentation even if your object doesn't have an admin form.






15. Negation operator for Q objects.






16. Here - you can't use add - create - or assignment (i.e. - beatles.members = [...]) to create relationships. You need to specify all the detail for the relationship required by the intermediate model.






17. Keyword shortcut for looking up an object by primary key.






18. A Python "magic method" that returns a unicode "representation" of any object.






19. Lookup type that returns results greater than a given value.






20. A manager method that returns a new QuerySet containing objects that do not match the given lookup parameters.






21. By default - results returned by a QuerySet are ordered by the ordering tuple given by the ordering option in the model's Meta. You can override this on a per-QuerySet basis by using the this method.






22. This model method saves a model instance to the database. This method has no return value.






23. This gives your model metadata.






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






25. Used to get a QuerySet for a model. This is called 'objects' by default.






26. This tells Django how to calculate the URL for an object. Django uses this in its admin interface - and any time it needs to figure out a URL for an object.






27. Specifies the model that will be used to govern the many-to-many relationship. You can then put extra fields on the intermediate model. The intermediate model is associated with the ManyToManyField using this to point to the model that will act as an






28. Fields are specified by these






29. This model method is used for updating a ManyToManyField.






30. Takes a list of primary-key values and returns a dictionary mapping each primary-key value to an instance of the object with the given ID.






31. Lookup type that returns results with a case-sensitive end sequence.






32. Disjunction operator for Q objects.






33. The value given in the absence of a specified value for the field. This can be a value or a callable object. If callable it will be called every time a new object is created.






34. These add custom "row-level" functionality to your objects. These act on a particular model instance.






35. 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






36. Returns a dictionary of aggregate values (averages - sums - etc) calculated over the QuerySet. Each argument to this method specifies a value that will be included in the dictionary that is returned.






37. This field is added automatically - but this behavior can be overridden






38. To activate your models






39. This object allows you to compare the value of a model field with another field on the same model. Django supports the use of addition - subtraction - multiplication - division and modulo arithmetic with these objects - both with constants and with o






40. 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.






41. what the field _______ determines: (1) The database column type (e.g. INTEGER - VARCHAR); (2) The widget to use in Django's admin interface - if you care to use it (e.g. <input type="text"> - <select>); (3) The minimal validation requirements - used






42. Defined by django.db.models.ForeignKey. You use it just like any other Field type: by including it as a class attribute of your model.






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






44. Defined by a ManyToManyField. You use it just like any other Field type: by including it as a class attribute of your model.






45. Lookup type that returns results with a case-insensitive end sequence.






46. This query updates all the headlines with pub_date in 2007 to read 'Everything is the same'.

Warning: Invalid argument supplied for foreach() in /var/www/html/basicversity.com/show_quiz.php on line 183


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






48. Each one of these is a Python class that subclasses django.db.models.Model. Each attribute of one of these represents a database field.






49. Lookup type that corresponds to a boolean full-text search - taking advantage of full-text indexing. This is like contains but is significantly faster due to full-text indexing.






50. A Q object that encapsulates queries for entries with a question value that starts with 'What' in a case-insensitive fashion.

Warning: Invalid argument supplied for foreach() in /var/www/html/basicversity.com/show_quiz.php on line 183



Sorry!:) No result found.

Can you answer 50 questions in 15 minutes?


Let me suggest you:



Major Subjects



Tests & Exams


AP
CLEP
DSST
GRE
SAT
GMAT

Most popular tests