Shawn Milochik wrote:
> I know this doesn't answer the hard part of your question, but here's  
> a simple way I delete old stuff from a database via an external script  
> that's run by cron:
> 
> Item.objects.filter(date_updated__lte = datetime.now() - timedelta 
> (days = 30)).delete()

Yep, that's prettymuch what I ended up writing. Wow, Django's ORM 
expressions are ugly compared to SQLAlchemy ;-)

> old. As for your complicated references, assuming you don't have  
> cascading deletes happening automatically, you may have to do an  
> objects.filter(),

Well, cascading deletes do happen automatically with Django, so no 
problem there...

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk

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