On Mon, 2009-02-02 at 14:36 +0530, Kenneth Gonsalves wrote: > hi, > I have an old site running on revision 2486 - had not touched it for years > and > since it wasnt broken nor needed new features, I did not upgrade it. A new > model was required, so I added it, but it was not appearing in sqlall > statement. The application is called 'web' and under the directory 'web' > there are 2 files 'models.py' and 'views.py'. The new model was > called 'Affiliation', and the site started barfing saying 'cannot import > affiliations'. I then noticed that views.py had a statement: > > from myapp.web.models.web import * > > there is a directory called myapp.web.models, but that only held an > __init__.py file which was empty. In those days django required for models in > an app called web, to have a directory like > web/models/web.py and /web/views/web.py. Apparently some years back I had > changed this to the current directory structure as web/views.py and > web/models.py. But I could not understand how the site was working until I > saw on the production server a file called ~/models/web.pyc. The site had > been using this all these years which is why my new model was not noticed. I > restored the old directory structure - the site load fine now. But - in > admin, the only things that show up are are auth and core - no sign of 'web'. > Any clues (I know I should not expect people to help out on such old stuff, > but if there *are* any oldtimers with long memories ...)
It's possible you've hit a very old bug that is triggered depending upon import orders and chained imports and the like. The final patch against ticket #1796 is what fixed it (note that the ticket title is only the tip of the iceberg; the final patch and resolution is what's important). You might need to backport the equivalent of r5919 (and possibly some other patches that I can't remember now, for checking whether the many-to-many cache in the Options class can be used). Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---