Wednesday, February 22, 2012

Update primary key and update child tables

I wrote a small snippet to update a primary key and update all child tables, which have a foreign-key to this table:

http://djangosnippets.org/snippets/2691/

Usage: manage.py update_primary_key table_name column_name value_old value_new

It uses the django db introspection (not the ORM ).

Thomas Güttler

--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail
: guettli (*) thomas-guettler + de

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate