Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add needed Imports to the Documentation #1129

Merged
merged 4 commits into from May 19, 2013

Conversation

Projects
None yet
4 participants
Contributor

frog32 commented May 18, 2013

@mjtamlyn
We added missing imports and checked the examples in the following chapters of the documentation:

All three chapters have been checked by a second person, but there may be more missing imports.

@mjtamlyn mjtamlyn commented on an outdated diff May 18, 2013

docs/ref/models/instances.txt
@@ -132,6 +135,7 @@ automatically provide a value for a field, or to do validation that requires
access to more than a single field::
def clean(self):
+ from datetime import datetime
@mjtamlyn

mjtamlyn May 18, 2013

Member

This import is wrong - the code is using datetime.date.today not the non-existant datetime.datetime.date.today

@mjtamlyn mjtamlyn commented on an outdated diff May 18, 2013

docs/topics/class-based-views/mixins.txt
@@ -546,6 +548,8 @@ template as ``AuthorDisplay`` is using on ``GET``.
.. code-block:: python
+ from django.core.urlresolvers import reverse
+ rom django.http import HttpResponseForbidden
Member

mjtamlyn commented May 18, 2013

Otherwise, all looks good. This is great work guys, well done.

Contributor

frog32 commented May 18, 2013

@mjtamlyn fixed the the two remaining bugs and, thank you for reviewing thigs.

selene:docs frog32$ git diff origin/master HEAD
diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt
index b9bc858..f989ff1 100644
--- a/docs/ref/models/instances.txt
+++ b/docs/ref/models/instances.txt
@@ -135,7 +135,7 @@ automatically provide a value for a field, or to do validation that requires
 access to more than a single field::

     def clean(self):
-        from datetime import datetime
+        import datetime
         from django.core.exceptions import ValidationError
         # Don't allow draft entries to have a pub_date.
         if self.status == 'draft' and self.pub_date is not None:
diff --git a/docs/topics/class-based-views/mixins.txt b/docs/topics/class-based-views/mixins.txt
index 79de00b..980e571 100644
--- a/docs/topics/class-based-views/mixins.txt
+++ b/docs/topics/class-based-views/mixins.txt
@@ -549,7 +549,7 @@ template as ``AuthorDisplay`` is using on ``GET``.
 .. code-block:: python

     from django.core.urlresolvers import reverse
-    rom django.http import HttpResponseForbidden
+    from django.http import HttpResponseForbidden
     from django.views.generic import FormView
     from django.views.generic.detail import SingleObjectMixin
Member

mjtamlyn commented May 19, 2013

Wonderful work guys, thank you very much!

@mjtamlyn mjtamlyn added a commit that referenced this pull request May 19, 2013

@mjtamlyn mjtamlyn Merge pull request #1129 from frog32/master
Add needed Imports to the Documentation
33c361e

@mjtamlyn mjtamlyn merged commit 33c361e into django:master May 19, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment