I was using the same shell. I also tried shutting down the server, rebooting the machine and opening everything up again to see if that would make any difference but it did not.
However, then a few hours later - it started to work again. I still don't fully understand the reason. I can only assume that my path was somehow faulty. However, that doesn't fully explain why Django was using my model file perfectly ok in some instances (such as in the Admin and in the DB), but not in the shell or through my views. MerMer On Mar 20, 12:04 pm, "Ramiro Morales" <[EMAIL PROTECTED]> wrote: > On 3/20/07, Merric Mercer <[EMAIL PROTECTED]> wrote: > > > > > > > Another observation after more investigation. > > > I decided to do the following:- > > > 1. Drop the table (again) from the DB. > > 2. Alter the Model in Django. This time I deleted one of the original > > fields named "rrp". > > > Then:- > > > 1. I re-ran syncdb. This confirmed the creating of a new table in the db > > 2. I checked the db and the admin - again both of these showed up > > correctly with all the fields from my Model. > > 3. In the shell I then tried to run a query set on the table. I got > > the following error > > > " OperationError: (1054, "unknown column 'promotions_product.rrp' in > > field list)" > > > This was the field that I deleted from the model. > > > This is making me conclude that django is using two versions of the > > information in my Models. The updated version is being used to > > correctly update the database and the admin - but the older version is > > being used to run the query sets. > > Are you opening a new Python shell (with the myproject.promotions import) > after any of your model/database modifications or have been > maintaining the same shell session open from before you started > these mods?. > > Regards, > > -- > Ramiro Morales --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---