Commits

Matthew Schinckel committed 91dc1b3

Import datetime, too.

Comments (0)

Files changed (3)

 django-shell+
 =================
 
-A management command to start a shell, and auto-import all models.
+A management command to start a shell, and auto-import all models, and the datetime module.
 
 Usage::
 
 
 setup(
     name = "django-shell-plus",
-    version = "1.1",
+    version = "1.1.2",
     description = "django-admin.py shell+  <- shell with models auto-imported",
     url = "http://bitbucket.org/schinckel/django-shell+/",
     author = "Matthew Schinckel",

shell+/management/commands/shell+.py

 import os
 from django.core.management.base import NoArgsCommand
 from optparse import make_option
+import datetime
 
 class Command(NoArgsCommand):
     help = "Runs a Python interactive interpreter."
         # Set up a dictionary to serve as the environment for the shell, so
         # that tab completion works on objects that are imported at runtime.
         # See ticket 5082.
-        imported_objects = {}
+        imported_objects = {'datetime':datetime}
         
         # Put all of the models into the local namespace.
         for model in loaded_models: