That does indeed work, just remember you can only reload modules, not individual classes you've imported from a module.
Mike On 12 Jun 2008, at 09:52, Gregor Müllegger wrote: > > Maybe the builtin function ``reload`` might help you: > http://docs.python.org/lib/built-in-funcs.html > > I haven't tested it with django but it should work like that: > >>>> from yourapp import models >>>> # Do stuff with your model >>>> # Change models sourcecode >>>> models = reload(models) >>>> # Do more stuff with your new models > > Gregor > > On 12 Jun., 03:01, "Gene Campbell" <[EMAIL PROTECTED]> wrote: >> I'm very new to Python and Django, I'm going through building some >> models for the first time. >> When I load the models in my shell like this >> >> python manage.py shell >> >>>>> from app.models import ModelClass >> >> then make a change to the ModelClass in models.py >> >> Now when back in the shell how do I reload the changes. This is no >> doubt simple and due to my lack of experience with Python and Django. >> I have tried >> >> reload(app.models) >> reload(app.models.ModelClass) >> reload(models) >> etc. >> >> I can, of course, ctrl+D, and restart the shell, then reimport and >> the >> changes are there. Is that the only way? >> >> thanks! > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---