lundi 3 août 2015

Translate Django models to generateDS instances

I have some Django models already defined, I'm planning to translate those into generateDS objects in order to create the corresponding xml's.

The generateDS classes are automatically generated using xml schemes.

I immediatly thought in iterating by the properties of my model object and checking if the property exists then assign the equivalent property on the generateDS object, but there should be a better way, right?

Basically what I'm trying to do is to translate one type of object into another type of object.

Is there a common pattern to achieve this?

What's the best approach to solve it?

Aucun commentaire:

Enregistrer un commentaire