On Apr 29, 8:06 am, Vincent <pho...@gmail.com> wrote:
> No, i did not mean this.
> The situation is, i have model A and model B, B has a foreignkey point to
> A,.
>
> now i find that i wanna delete records of A without deleting records of B
> which pointing to A.
> i think i could reset the B's foreignkey field to integerfield.
>
> But i consider it is not the best answer, because there are a lot of similar
> problems, and some of which should be delete, the others should not be
> delete.
>
> is there any suggestion.
>

You could try defining the foreign key with null=True.
    a = models.ForeignKey(A, null=True)
--
DR.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to