Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schöneres Syncen: Code aufhübschen #8

Open
the-infinity opened this issue Feb 27, 2020 · 0 comments
Open

Schöneres Syncen: Code aufhübschen #8

the-infinity opened this issue Feb 27, 2020 · 0 comments

Comments

@the-infinity
Copy link
Contributor

Den Code vom Sync-Client könnte man wirklich hübscher machen:

https://github.com/politik-bei-uns/daemon/blob/master/oparlsync/oparl_download/OparlDownload.py

Eine der fiesesten Dinge ist dabei diese riesige sehr abstrakte Loop. Eine der größten Gemeinheiten dort ist, dass sich document_type_obj zur Laufzeit von einem String zu einem Objekt ändert (uäh!), was von Mongoengine reinkommt und viel Spaß beim Debuggen gibt. Aber auch so: das ließe sich sicherlich aufhübschen, indem man das in mehr Codefragmente aufteilt.

Es ist auch eine Überlegung wert, manchmal nicht gar so abstrakt zu agieren. Diese extrem abstrakte Darstellung mit "alles definiert sich über das MongoEngine Datenmodell" hatte ich damals gewählt, weil wir nicht wussten, wie stabil und zuverlässig die OParl-Relationen auf nahezu alle Gegebenheiten passen. Da nun aber klar ist, wie gut OParl zur Realität passt, könnte man auch überlegen, das Abstraktionslevel zu senken, wenn das zu besser zu wartendem Code führt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant