I'm fairly new to python and Django but I've got a fair bit of
experience with general web development. My problem is that I'm having
trouble figuring out the best way in Django to copy an object (with
several foreign keys and many to many items) into an other completely
different object and adding a couple extra pieces of data.

For example, if I had a Product model (with m2m Categories, m2m
Attributes and related Manufacturer) and I wanted to copy it to a
"ProductStorage" model that was exactly the same model but had a
"datestored" field as well. Similarily, I need to copy the categories
and the attributes and the manufacturers. I would like a complete
"snapshot" of the data at a particular point in time.

To me, it seems like this sort of duplicate functionality would be
simple if I just had to copy one thing but I'm worried about that fact
that I have to copy all the related data as well.

Would it be better to run a function in Postgres? Is there a Django way
to do this? Is there a python way to do this? I'm open to any
suggestions.


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

Reply via email to