I've been looking at save() recently for work on http://code.djangoproject.com/ticket/4102 and I noticed what seems to be a problem in the primary key logic, but I'm not entirely sure :)
In the block for saving an existing model object, it uses the non_pks list which is generated by testing for the primary_key flag on fields, however the block for inserting a new row tests if the field is an AutoField, not if it has primary_key set. Wouldn't this cause it to insert the primary key field regardless of if you'd specified it or not? As I think about it, a non-auto primary_key probably has to be specified in most situations, but it seems like it should still check :) I'm also curious for thoughts on an issue with the ticket I mentioned above; should the specified list of fields be used for inserting as well as updating? And if it should, should the pk be used if specified in the model regardless, or should you have to specify it in the field list? (or should I move this question to the ticket itself?) Thanks for any insights (or corrections) :) -- Collin Grady --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
