This repository has been archived by the owner on Aug 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor modeling to avoid magic as much as possible
My previous stab at implementing the simple-modeling-orm-thing-tm failed in the aspect that there was a lot of duplicated code doing runtime inspection of stuff. This was due mostly to having no extra place to store information on types, making it hard to introspect how the type expected to be built, whether it had a default, etc. This commit refactors the modeling code to actually have a Field type, which wraps some information up in a simple class and allows extremely easy conversion without having to do (more) expensive runtime inspection. This also gives us the benefits of a much more readable/cleaner code, expandable field options, and not having to fuck with sphinx to get docs working correctly (it was duping attributes because they where aliases...)
- Loading branch information
1 parent
c297d45
commit ffe5a6f
Showing
10 changed files
with
322 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.