|
|
Thomas De Schampheleire
|
d75d9ce1320d
|
9 years ago
|
|
model: move code from __init__.py to base.py Having too much code, in particular too much imports, inside a package's __init__.py is a recipe for circular imports, and considered bad practice in Python [1] Move out everything from kallithea/model/__init__.py to a new file kallithea/model/base.py and adapt the existing imports. [1] http://docs.python-guide.org/en/latest/writing/structure/#packages
|
|
|
Søren Løvborg
|
91b38dc6d891
|
10 years ago
|
|
model: refactor and simplify _get_instance
_get_instance is a BaseModel method, but never uses "self". Instead it takes a class argument, which indicates that it's better suited as a classmethod on said classes.
Also rename to something more descriptive, remove leading underscore since it's not a private API, and refactor for readability.
|
|
|
Søren Løvborg
|
3d1fcf67f299
|
10 years ago
|
|
model: drop BaseModel.cls
It no longer serves a purpose.
|
|
|
Søren Løvborg
|
974d6470cbec
|
10 years ago
|
|
model: inline BaseModel.get_all
This is just needless indirection (and doesn't actually add any abstraction on top of the database object), so inline all calls to it.
Don't touch PullRequestModel.get_all, though, since it is an entirely unrelated method that just shadows the inherited get_all.
|
|
|
Søren Løvborg
|
1e52ed5c37aa
|
10 years ago
|
|
db: remove deprecated getAll method
Not sure why this wasn't done immediately when get_all was added. Maybe search and replace was out of order at the time.
|
|
|
Mads Kiilerich
|
0ad053c172fa
|
11 years ago
|
|
cleanup: make module self-naming consistent
The self naming is quite pointless ... but at least make it right.
|
|
|
Mads Kiilerich
|
0210d0b769d4
|
11 years ago
|
|
|
|
|
Mads Kiilerich
|
63bed817308c
|
11 years ago
|
|
cleanup: check for None object identity in cases where that is what the 'contract' says
Avoid applying bool() on complex objects - it might return something unexpected such as the key (which might be 0 and thus be false). Checking for None is more safe and faster.
|
|
|
Bradley M. Kuhn
|
24c0d584ba86
|
12 years ago
|
|
|
|
|
Bradley M. Kuhn
|
1948ede028ef
|
12 years ago
|
|
|
|
|
Bradley M. Kuhn
|
ad38f9f93b3b
|
12 years ago
|
|
Correct licensing information in individual files.
The top-level license file is now LICENSE.md.
Also, in various places where there should have been joint copyright holders listed, a single copyright holder was listed. It does not appear easy to add a link to a large list of copyright holders in these places, so it simply refers to the fact that various authors hold copyright.
In future, if an easy method is discovered to link to a list from those places, we should do so.
Finally, text is added to LICENSE.md to point to where the full list of copyright holders is, and that Kallithea as a whole is GPLv3'd.
|
|
|
Bradley M. Kuhn
|
d1addaf7a91e
|
12 years ago
|
|
Second step in two-part process to rename directories. This is the actual directory rename.
|