Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {'a':{'b':'c',
- 'd':'e',
- 'f':'g',
- 'h':{'i':'j',
- 'k':'l',
- 'm':'n'
- }
- }
- 'o':'p'
- }
- {'a':{'b':{'c':{'d':'e',
- 'f':'g'
- }
- }
- }
- }
- class XMLStructure(Model.models):
- node_name = models.CharField()
- parent = models.ForeignKey('XMLStructure')
- @staticmethod
- def get_root(self):
- # return the root of the structure
- def has_children(self):
- # return true / false if it's a leaf
- @staticmethod
- def get_leaves(self):
- # return all leaves of my xml
- dict_as_list = ['a','/','b','d','f','h','/','i','k','m','','','o','']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement