Saturday, January 21, 2012

Re: Why can't erase this model object? "AssertionError: Question object can't be deleted because its id attribute is set to None."

On Jan 21, 2:43 pm, JohnA <john.armstrong....@gmail.com> wrote:
> 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.

In the Django shell I do

quests = Question.objects.all()
quests[579].delete()

Why does the objects.all() invocation add this id=None crud to quests
list?

cs

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate