Wow, that does the trick! Thank you very much.
I'm not exactly sure what this command does, though
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to djang
Hi cyberco,On 8/13/06, cyberco <[EMAIL PROTECTED]> wrote:> Is there a way to pick up the changes without restarting the shell?
Try to commit the current transaction:import django.dbdjango.db.connection._commit()-- Obstáculos es lo que ves cuando apartas la vista del objetivo.
--~--~-~--~---
Yes, but the disadvantage of using 'import x.y.z as mymodel' instead of
'import x.y.z'b is that instead of using a = A() I have to say a =
mymodel.A().
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
However, keep in mind Pedro's example, where he uses "import x.y.z as
a" and then later calls "reload(a)". In other words, using the "as"
functionality of import lets you have the best of both worlds--reload()
will work, and you can still get a single-word binding in your
namespace for your Model
On Sun, 2006-08-13 at 22:05 +, cyberco wrote:
> I may have cheered to early: what if I don't use 'import as', but
> 'site.app.models import *'? If I do 'reload(models)' the Django models
> are reloaded, and doing 'reload(site.app.models)' throws an exception
> saying 'site' does not exist...
I may have cheered to early: what if I don't use 'import as', but
'site.app.models import *'? If I do 'reload(models)' the Django models
are reloaded, and doing 'reload(site.app.models)' throws an exception
saying 'site' does not exist...
--~--~-~--~~~---~--~~
You
Ah! Thanks for the tip! I totally forgot about Python's reload method
because my mind was on a 'db-track' all the time.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, se
Module reload works as expected
>>> import uatki.blogdata.models as m
>>> e = m.Blog.objects.get(id=1)
>>> e.test()
Traceback (most recent call last):
File "", line 1, in ?
AttributeError: 'Blog' object has no attribute 'test'
[ changed the model to have a test method ]
>>> reload(m)
>>> e =
Using the ipython started from manage.py I noticed that changes to the
db are not automatically picked up (added values for instance). I have
to restart the shell to pick them up, which also means I have to
reimport everything and I loose my shell history.
Is there a way to pick up the changes w
9 matches
Mail list logo