On Jul 18, 6:14 pm, Nis Jørgensen <[EMAIL PROTECTED]> wrote: > AnaReis skrev:> Hi all, > > I have a problem when inserting a register into this table that I'm > > working with. > > This table belongs to a MySQL database and the storage engine is > > MyISAM. The database that I'm using is a legacy database and I can't > > change it in any way. > > When I insert a register into the table it's MySQL who generates the > > primary key for me. Which means that I fill all the required table > > fields and leave the primary key field empty for MySQL to fill when I > > insert the record. The problem is, since the ".save()" method doesn't > > return any value there is no way for me to give any confirmation for > > the user if the register was inserted or not. > > Have you added the primary key to the model, like this: > > my_legacy_id = AutoField() > > If you do, I believe you will be able to read the value of the field > after calling .save(). > At least you can with the standard id field when using postgresql. > > Nis Hi Thanks for your help! I had put the AutoField() part but forgot to add the "_id" in the end of the field, that's why it wasn't working. Thanks again! :) Ana --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---