Workshop
The workshop consists of a set of questions and answers designed to solidify your understanding of the material covered in this hour. Try answering the questions before looking at the answers.
Quiz
1. | How do you access the current site object from a view? |
2. | How do you limit a model to being accessed in only one site? |
3. | How do you control access of a model in multiple views? |
4. | How do you get the domain name for a site? |
Quiz Answers
1. | Call the Site.objects.get_current() function. |
2. | Add a ForeignKey field that links to the django.contrib.sites.models.Site object. |
3. | Add a ManyToMany field that links to the django.contrib.sites.models.Site object. |
4. | Access the domain attribute of the Site object. |