Hello,
I have a MySQL table that gets cleared in the morning, populated
during the day, appended onto a backup table and the contents then
deleted.
The raw SQL is something along the lines of "INSERT INTO backup SELECT
* FROM today; DELETE FROM today;".
Is there a Django way of doing this? I would required something
similiar to this:
todays_records = Today.objects.all()
for record in todays_records:
Backup.objects.create(record)
I am aware I could simply do
for record in todays_records:
Backup.objects.create(value1=record.value1, value2=record.value2)
But I would think there is a better method I am not aware of?
Both Today table and Backup table have the exact same layout.
Any help would be appreciated
Mike
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---