Exemplo n.º 1
0
    def create_submission(self, root):

        cls = Registry.get_submission(root.get("type"))

        if not cls:
            return None

        kwargs = {}

        for prop in root.xpath("./property"):
            kwargs[prop.get("name")] = prop.text

        submission = cls(**kwargs)

        return submission
Exemplo n.º 2
0
    def create_submission(self, root):

        cls = Registry.get_submission(root.get("type"))

        if not cls:
            return None

        kwargs = {}

        for prop in root.xpath("./property"):
            kwargs[prop.get("name")] = prop.text

        submission = cls(**kwargs)

        return submission