On Wed, Apr 29, 2009 at 2:57 AM, Vincent <pho...@gmail.com> wrote:
> Hi,
> I got a problem like this:
> class A(models.Model):
>     id = models.AutoField(primary_key=True)
>     field1 = models.TextField()
> class B(models.Model):
>     a = models.ForeignKey(A)
>     field1 = models.TextField()
> then there are some records of A/B,
> how can i delete records of A and do not delete records of B which have
> foreignkey on A

Did you mean how to delete records of A for which there are no records
in B pointing to them through the foreign key "a", right?

-- 
Marcelo Ramos
Django/Python developer

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