Opened 20 years ago
Closed 20 years ago
#591 closed defect (invalid)
[patch] Docs: Subclassing wrong object
| Reported by: | Boffbowsh | Owned by: | Jacob |
|---|---|---|---|
| Component: | Documentation | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Index: /usr/local/django_src/docs/templates_python.txt
===================================================================
--- /usr/local/django_src/docs/templates_python.txt (revision 764)
+++ /usr/local/django_src/docs/templates_python.txt (working copy)
@@ -267,7 +267,7 @@
from django.core.template import Context
import datetime
- class TimeContext(template.Context):
+ class TimeContext(Context):
def __init__(self, *args, **kwargs):
Context.__init__(self, *args, **kwargs)
self['current_time'] = datetime.datetime.now()
Change History (5)
comment:1 by , 20 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:2 by , 20 years ago
Actually, just realised, it should be:
Index: /usr/local/django_src/docs/templates_python.txt
===================================================================
--- /usr/local/django_src/docs/templates_python.txt (revision 764)
+++ /usr/local/django_src/docs/templates_python.txt (working copy)
@@ -265,9 +265,9 @@
each template something "automatically." For instance, if you want to give
every template automatic access to the current time, use something like this::
- from django.core.template import Context
+ from django.core.extensions import DjangoContext as Context
import datetime
- class TimeContext(template.Context):
+ class TimeContext(Context):
def __init__(self, *args, **kwargs):
Context.__init__(self, *args, **kwargs)
self['current_time'] = datetime.datetime.now()
comment:3 by , 20 years ago
3rd time lucky:
Index: /usr/local/django_src/docs/templates_python.txt
===================================================================
--- /usr/local/django_src/docs/templates_python.txt (revision 771)
+++ /usr/local/django_src/docs/templates_python.txt (working copy)
@@ -265,7 +265,7 @@
each template something "automatically." For instance, if you want to give
every template automatic access to the current time, use something like this::
- from django.core.template import Context
+ from django.core.extensions import DjangoContext as Context
import datetime
class TimeContext(Context):
def __init__(self, *args, **kwargs):
comment:4 by , 20 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
comment:5 by , 20 years ago
| Resolution: | → invalid |
|---|---|
| Status: | reopened → closed |
It's correct as currently written -- there's no need to use DjangoContext in this example.
Note:
See TracTickets
for help on using tickets.
(In [771]) Fixed #591 -- fixed typo in docs/templates_python.txt. Thanks, Boffbowsh