But of course! Thank you.

On Nov 17, 8:25 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Mon, Nov 17, 2008 at 9:06 PM, Merrick <[EMAIL PROTECTED]> wrote:
>
> > I cannot figure out how to update a foreign key to a null value.
> > Thanks.
>
> > models.py
> > ========
> > group = models.ForeignKey(group, null=True, blank=True)
>
> > >>> from redirect.models import *
> > >>> Links = Link.objects.filter(group = 6)
> > >>> Links.update(group = NULL)
>
> > Traceback (most recent call last):
> >  File "<console>", line 1, in ?
> > NameError: name 'NULL' is not defined
>
> > >>> Links.update(group = 'NULL')
> > ...
> > ProgrammingError: invalid input syntax for integer: "NULL"
>
> Try None instead of NULL.
>
> Karen
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to