Doesn't the Create method or the YourModel() constructor initialize the pk ?
El 21 de enero de 2012 12:43, JohnA <john.armstrong....@gmail.com> escribió: > How are you finding these objects? That might point to the answer. > > Probably the likeliest explanation is that you are creating the > objects but not saving them. > > On Jan 21, 12:31 pm, Chris Seberino <cseber...@gmail.com> wrote: > > On Jan 21, 6:44 am, Tom Evans <tevans...@googlemail.com> wrote: > > > > > Models are representations of rows in a database. > > > Deleting a model instance implies removing a row from a database. > > > Model instances have an id attribute which denotes their row in the > database. > > > Models whose id is None don't exist in the database, and so it is > > > nonsense to delete them - they don't exist. > > > > That makes perfect sense but then why do these zombie id=None objects > > show up? > > *WHERE* are they living if not in the database? Does the Django shell > > somehow have a secondary storage area for this zombie id=None object > > stuff I can delete somehow? > > -- > 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. > > -- Regards, Leandro Ostera, *BLOG - Check what I'm doing now <http://imakeapps.alwaysdata.net> EMAIL - Write me an email <leost...@gmail.com> SHOWCASE - Check my latest projects <http://ishowcase.alwaysdata.net>* -- 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.