On 10/3/07, Nabuco <[EMAIL PROTECTED]> wrote:
>
> In a view I receive some videokeyword id's existing in a Video to be
> deleted. I tried
>
> sql = 'videokeyword_id IN (keywords)' <-- (filling keywords
> placeholder with the id's, of course)
> keywords = get_list_or_404(video.keywords_list.extra(where=[sql]))
> for k in keywords:
>     k.delete()

It looks to me that what you want is:

video.keywords_list.remove(keywords)

where keywords is a list of Keyword objects, or a list of primary keys
of Keyword objects.

For more details:
http://www.djangoproject.com/documentation/db-api/#backward

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to