Skip to content

Deverbositation of the client interface. #29

@jarovo

Description

@jarovo

Currently python-fakturoid-v3 is based on following patterns:

fa = Fakturoid(...)
new_instance = fa_instance.collection.verb(Noun(attribute_name1=value, ...)))

This is cumbersome because the collections needs to be tightly bound to the nouns they are creating. It may be better to just have following pattern:

fa = Fakturoid(...)
new_instance = Noun(attribute_name1=value).verb(fa)

or perhaps we can have the noun bound to the Fakturoid instance

fa=Fakturoid(...)
new_instance = fa.Noun(attribute_name1=value).verb()
new_instance.attirbute_name1="new_value"
new_instance.verb2()

update, listing, searching, filtering could be done this way:

Noun(id=2045).load() -> self
Noun(name="foo").index() -> Iterator[Noun]
Noun(attr="foo").search() -> Iterator[Noun]

as verb is bound to the class of Noun in the time of de-referencing, there is no question about which collection is to be used for which Noun. Each noun would have the collection set in the creation time as an instance attribute.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions