On Apr 29, 8:06 am, Vincent <[email protected]> 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 [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
-~----------~----~----~----~------~----~------~--~---