On Tue, Aug 09, 2016 at 04:18:43PM +0000, Nikos Zikos wrote: > Hello Dave > Im working on a project with your tool generateDS in Django and I have > a question: > It is really easy to parse XML into a class (lets say class Person) and > vice versa butA > is there any easy way to pass all info from class Person to model class > Person_modelA > and vice versa, so I can store it in the db.A > The schema I want to implement is: > XML-->Person-->Person_model-->db-->Person_model-->Person-->XML > Thanks in advance >
Nikos, If I understand what you are suggesting, the missing steps are: Person --> Person_model and: Person_model --> Person where Person is a class generated by generateDS.py. In effect, we'd like (1) to take an instance of the Person class and store it in the django DB/ORM and (2) to take that information in the django DB/ORM and recreate the instance of the Person class. No, there is no explicit support for that. However, if you look at the code that generates the django models you will see that (1) there is a replacement for the common superclass of the classes generated by generateDS.py and (2) the class member information that is generated by the --member-specs=list|dict option is used. So, we might look at: generateds/django/generatedssuper.py generateds/django/gends_generate_django.py For clues about how either (1) to create a another common superclass or (2) perhaps more hopefully, to write a script that uses the member-spec information to perform the transformations you are suggesting. I'm on vacation right now, enjoying spectacular scenery in eastern California, U.S.A. on the back (east) side of the Sierra Nevada Mountains and in the White Mountains; and also took a walk through a grove of Bristlecone Pines, which are among the oldest living organisms we have. I'll be back in a couple of days and will look at this a bit more. But, I suspect that there will not be any quick solution for this. More later. Dave > -- > > Dr. Nikos Zikos > Department of Electrical and Computer Engineering, > Aristotle University of Thessaloniki, > GR54124 Thessaloniki, GREECEA A > Tel/Fax:A A A A + 30- 2310- 996377 > email:A A A A A A [1]nzi...@auth.gr > > References > > 1. mailto:nzi...@auth.gr -- Dave Kuhlman http://www.davekuhlman.org ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. http://sdm.link/zohodev2dev _______________________________________________ generateds-users mailing list generateds-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/generateds-users