thanks a lot.. that fixed it. Even after making the mess that i made, a syncdb solved the issue keeping all my other data intact.
I however have a related question. While modifying the existing classes, i.e. adding fields, i do the "ALTER TABLE" by hand as suggested by http://www.djangobook.com/en/1.0/chapter05/ Am I gonna run into trouble for this with auth or something else? On Nov 24, 12:58 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2008-11-23 at 21:47 -0800, sajal wrote: > > Apologies for the lack of details, didnt really know what details to > > provide. > > > Here is what I did. > > Good step-by-step accounting of what you did. Makes it easy to spot > where the problem is. > > > 2 users (one superadmin and one regular user) > > make a new "app" and add few models to it. > > Assign permission for the new models class to the staff user via the > > django admin interface. > > modify the existing models - and accordingly run "ALTER TABLE" > > commands in pgsql > > Add 2 new classes , paste the create table queries generated by sqlall > > <appname> into pgsql > > This is the problem step: creating *new* tables by hand. > > The admin permissions are stored in a table called auth_permission. They > are filled in after "syncdb" is run. So when you create a new model, you > should generally try to create the table by running "manage.py syncdb", > rather than just the cutting-and-pasting trick. Syncdb will create > tables for any models that don't exist. What it doesn't do is alter > existing tables (which is why you have to do ALTER TABLE commands when > you adjust a model after initially creating it). > > At the completion of a syncdb command, any new models have their > permissions inserted into the auth_permission table. Since you skipped > that step (syncdb), the table isn't correctly populated. You'll also > have a few other problems, such as the django_content_type table not > being populated for that model. > > My suggestion would be to drop the table you created from scratch by > hand and manually run syncdb to have it inserted correctly. If that > isn't possible, you'll have to work out how to populate the content_type > and then auth_permission tables by hand, which will be possible, but > would be fairly fiddly. So, try really hard to drop the manually created > tables (e.g. dump their existing data to a file, drop the table, syncdb, > reload the data). > > 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---