Hi, I am in a trouble and need help. We have an application developed in Django and has a custom defined (Char Type) primary key. Due to few new features, we need to change the primary key to a AutoGenerated Key. We manually added a column named id, a sequence and a trigger (same naming convention as Django creates since doing syncdb for existing tables doesn't work). The problem the we are facing is- 1) The application works fine when "id" is added in the Job class in models (models.CharField(max_length=200, primary_key=True)). While saving, a job object, job.id or job.pk (job is the model name) returns None although "id" is generated in Db. 2) If we remove "id" from Job class (w/o removing the db column, sequence and trigger), the application works fine but its extremely slow. The query which takes .08 seconds is taking 31 seconds to execute. We face the same issue, if we replace the "id" as AutoField. The performance is very slow.
We can live with approach 1 but while running unit tests, it fails since it doesnt create the sequence and trigger on its own (note in approach 1, auto field is not specified) and by specifying auto field, tests work fine but the application is very slow. We need to fix this and its a bottle neck for us now. Any help on this will be highly appreciated. Thanks in advance.! Rakesh -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.