Git Product home page Git Product logo

composite's People

Stargazers

 avatar

Watchers

 avatar  avatar

composite's Issues

XML attributes structure issue

There's iterate through lxml document that looks like this:

class XMLDocumentBuilder(BaseDocumentBuilder):
    # ...
    @classmethod
    def iterate(cls, source):
        """
        iterate through source document

        :param lxml.etree.Element source: xml document
        :rtype: generator
        :return: tuple[node name, node]
        """
        if isinstance(source, etree._Element):
            for node in source.getchildren():
                yield (node.tag, node)
        else:
            for name, item in source.items():
                yield (name, item)

I suppose builder should not include check the type of object it iterates. Possible it could be resolved by somehow.

Resolve `magic numbers`

There's some magic numbers inside of code should be resolved or stay.

Think about it, resolve if needed.

Убрать лишнии методы из Document

#4

to и некоторые from, а также то что используется внутри будут являться лишними, так как их ответственность выполняет builder классы

Ошибка прямого обращения к __dict__

В процессе работы с библиотекой выяснилось, что обращение к дискриптору __dict__ инстанса класса Attributes происходит с ошибкой:
>>>offer.attributes.__dict__
*** TypeError: descriptor '__dict__' for 'Attributes' objects doesn't apply to 'Attributes' object
>>> type(offer.attributes)
<class '__main__.Attributes'>

Field in Attribute class would cause troubles

using Field inside Attribute subclass would cause a problem with xml parser, this is not bug just because AttributeField should be use instead. Lock or think something suitable solution for that programming interface lock

from composite import Document
from composite.fields import Field, AttributeField

class UserAttributes(Document):
    class Attribute:
        age = Field('age', int)  #: should be AttributeField

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.