On Dec 4, 8:37 pm, Phlip <[email protected]> wrote: > Django users: > > I only ask the question to help improve my esthetics, but others might > need a performance boost here. > > How to delete every record in a table? > > A related question - how to delete every record matching a filter, out > of one internal SQL command? > > The brute-force way: > > for p in Plutocrat.objects.all(): p.delete() > > Is there a way to do that in one method call? and could such a method > call only send one SQL command? >
Yes: Plutocrat.objects.all().delete() -- 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.

